/* CSS Variables - matching RESTHeart style */
:root {
    --primary-color: #0066CC;
    --primary-dark: #0052A3;
    --text-dark: #1a1a1a;
    --text-light: #666;
    --bg-light: #f8f9fa;
    --border-color: #e0e0e0;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
    --radius: 8px;
    --container-width: 1200px;
    --section-vertical: 2.25rem;
}

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

body {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text-dark);
    line-height: 1.7;
    font-size: 1.125rem;
    font-weight: 400;
    letter-spacing: -0.01em;
    -webkit-font-smoothing: antialiased;
}

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

/* Global section vertical rhythm — individual sections may override */
section { padding: var(--section-vertical) 0; }

/* Header */
.site-header {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem 0;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-dark);
    font-size: 1.5rem;
    font-weight: 700;
}

.logo img {
    display: block;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    position: relative;
}

.nav-links a:hover {
    color: #ffffff;
    background-color: var(--primary-color);
    transform: translateY(-2px);
}

.nav-links a:active {
    transform: translateY(0);
}

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 110;
}

.hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--text-dark);
    transition: all 0.3s ease;
    border-radius: 2px;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Mobile Navigation */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }
    
    .nav-links {
        position: fixed;
        top: 64px; /* Approx header height on mobile */
        right: -100%;
        width: 100%;
        max-width: 300px;
        height: calc(100vh - 72px);
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        flex-direction: column;
        gap: 0;
        padding: 2rem 0;
        box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease;
        overflow-y: auto;
        z-index: 120;
    }
    
    .nav-links.active {
        right: 0;
    }
    
    .nav-links li {
        width: 100%;
    }
    
    .nav-links a,
    .nav-links .nav-coming-soon {
        display: block;
        padding: 1rem 2rem;
        border-bottom: 1px solid var(--border-color);
    }
    
    .nav-links a:hover {
        background-color: var(--bg-light);
    }
}

/* Hero Section */
.hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    padding: 3rem 0;
    text-align: center;
}

/* dark overlay to guarantee WCAG contrast for hero text */
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.30);
    pointer-events: none;
    z-index: 0;
}

/* keep hero content above the overlay */
.hero > * {
    position: relative;
    z-index: 1;
}

/* site-dark uses a lighter overlay so hero doesn't become too flat */
.site-dark .hero::before {
    background: rgba(0,0,0,0.12);
}

.hero h1 {
    font-size: 3.8rem;
    margin-bottom: 1rem;
    font-weight: 700;
    letter-spacing: -0.6px;
    line-height: 1.2;
    /* subtle layered shadows for a gentle 3D/embossed look */
    text-shadow: 4px 4px 0 rgba(0,0,0,0.25), 18px 18px 28px rgba(0,0,0,0.18);
}

.hero .tagline {
    font-size: 2.1rem;
    margin-bottom: 1.5rem;
    opacity: 0.96;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.18);
}

.hero .description {
    font-size: 1.25rem;
    max-width: 760px;
    margin: 0 auto 1.25rem;
    line-height: 1.6;
    opacity: 0.92;
    text-shadow: 0 1px 0 rgba(0,0,0,0.06);
}

/* Slightly stronger text-shadow in dark-mode hero for consistent depth */
.site-dark .hero h1 { 
    color: #b3d9ff;
    text-shadow: 4px 4px 0 rgba(0,0,0,0.35), 20px 20px 32px rgba(0,0,0,0.45); 
}
.site-dark .hero .tagline { 
    color: #cce6ff;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.25); 
}
.site-dark .hero .description { 
    color: #cce6ff;
    text-shadow: 0 1px 0 rgba(0,0,0,0.12); 
}

/* Buttons */
.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    font-size: 1rem;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 2px solid white;
}

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

/* Features Grid */
.features {
    padding: var(--section-vertical) 0;
    background: white;
}

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

.feature-card {
    padding: 2rem;
    background: var(--bg-light);
    border-radius: var(--radius);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.feature-card .feature-icon {
    font-size: 2.5rem;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.feature-card h3 {
    color: var(--text-dark);
    font-size: 1.25rem;
    margin: 0;
    line-height: 1.3;
}

.feature-card p {
    color: var(--text-light);
    margin: 0;
    line-height: 1.6;
}

/* Ensure consistent vertical rhythm in use-cases */
.use-case { display:flex; flex-direction:column; gap:1rem; min-height:220px; }

/* Lead paragraphs and section titles */
.lead { max-width: 900px; margin: 0 auto 1rem; line-height:1.8; }
.section-title { margin-top:0; margin-bottom: 1rem; font-size: 1.9rem; }
.container > .section-title, .code-example h2.section-title { text-align:center; }

/* CTA spacing */
.cta-buttons, .cta-center { margin-top:2rem; margin-bottom:0; }

/* Accessibility focus for tabs */
.tab:focus { outline:2px solid var(--primary-color); outline-offset:2px; }

/* Unified content wrapper for intro and architecture sections */
.content-wrapper {
    max-width: 1000px;
    margin: 0 auto;
}
.content-wrapper .lead {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
    border-left: 4px solid var(--primary-color);
    border-radius: 4px;
}
.intro-features { display:flex; gap:1rem; list-style:none; padding:0; margin:0; }
.intro-features li { background: white; padding:0.5rem 0.75rem; border-radius:8px; border:1px solid var(--border-color); color:var(--text-dark); font-size:0.95rem; flex:1; }

@media (max-width: 900px) {
    .intro-features { flex-direction:column; }
}

/* Code Example Section */
.code-example {
    padding: var(--section-vertical) 0;
    background: var(--bg-light);
}

.code-example h2 {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2.5rem;
}

.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.tab {
    background: none;
    border: none;
    padding: 1rem 1.5rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-light);
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

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

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

.tab-content {
    display: none;
}

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

.tab-content pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 2rem;
    border-radius: var(--radius);
    overflow-x: auto;
    font-size: 0.95rem;
    line-height: 1.5;
}

.tab-content code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Courier New', monospace;
}

/* How It Works: steps layout */
.how-it-works .steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    align-items: stretch;
}
.how-it-works .step {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    background: white;
    padding: 1.25rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    height: 100%;
}
.how-it-works .step-number {
    flex: 0 0 48px;
    height: 48px;
    display: inline-grid;
    place-items: center;
    font-weight: 700;
    color: white;
    background: var(--primary-color);
    border-radius: 999px;
    font-size: 1rem;
}
.how-it-works .step-content h3 { margin: 0 0 0.5rem 0; }
.how-it-works .step-content p { margin: 0; color: var(--text-light); }

@media (max-width: 900px) {
    .how-it-works .steps { grid-template-columns: 1fr; }
}

/* HTMX Integration Section */
.htmx-integration {
    background: var(--bg-light);
}

.htmx-content .lead {
    text-align: center;
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.htmx-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.htmx-feature {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius);
    border-left: 4px solid var(--primary-color);
    box-shadow: var(--shadow);
}

.htmx-feature h3 {
    margin: 0 0 0.75rem 0;
    font-size: 1.25rem;
    color: var(--primary-color);
}

.htmx-feature p {
    margin: 0;
    color: var(--text-light);
}

.htmx-feature code {
    background: var(--bg-light);
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    font-size: 0.95em;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Courier New', monospace;
}

.htmx-example {
    background: white;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.htmx-example > h3 {
    margin: 0 0 1.5rem 0;
    font-size: 1.5rem;
    text-align: center;
}

.code-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.code-column h4 {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.code-column pre {
    margin: 0;
}

.htmx-note {
    background: #e8f4fd;
    border-left: 4px solid var(--primary-color);
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin: 0;
}

.htmx-note strong {
    color: var(--primary-color);
}

@media (max-width: 768px) {
    .code-columns {
        grid-template-columns: 1fr;
    }
}

/* HTMX Variables Table */
.htmx-variables {
    margin-top: 2rem;
}

.subsection-title {
    margin: 2rem 0 1rem 0;
    font-size: 1.5rem;
    text-align: center;
}

.variables-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.variables-table thead th {
    background: var(--primary-color);
    color: white;
    font-weight: 700;
    padding: 1rem;
    text-align: left;
    font-size: 0.95rem;
}

.variables-table tbody td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
}

.variables-table tbody tr:last-child td {
    border-bottom: none;
}

.variables-table code {
    background: var(--bg-light);
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    font-size: 0.9em;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Courier New', monospace;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .variables-table {
        font-size: 0.9rem;
    }
    
    .variables-table thead th,
    .variables-table tbody td {
        padding: 0.75rem 0.5rem;
    }
}

/* Next Steps Section */
.next-steps {
    background: var(--bg-light);
}

.next-steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.next-step-card {
    background: white;
    padding: 2rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.next-step-card h3 {
    margin: 0;
    font-size: 1.25rem;
}

.next-step-card p {
    margin: 0;
    color: var(--text-light);
    flex-grow: 1;
}

.next-step-card .btn {
    margin-top: auto;
}

/* SSR Explanation Section */
.ssr-explanation {
    margin-top: 3rem;
    padding: 2rem;
    background: white;
    border-radius: var(--radius);
    border-left: 4px solid var(--primary-color);
    box-shadow: var(--shadow);
}

.ssr-explanation h3 {
    margin: 0 0 1rem 0;
    color: var(--primary-color);
}

.ssr-explanation pre {
    background: var(--bg-light);
    padding: 1rem;
    border-radius: var(--radius);
    margin: 1rem 0;
}

/* Context Variables Section */
.context-variables {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius);
    margin-top: 1.5rem;
    border: 1px solid var(--border-color);
}

.context-variables h4 {
    margin: 1rem 0 0.5rem 0;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.context-variables h4:first-child {
    margin-top: 0;
}

.context-variables ul {
    margin: 0.5rem 0 1.5rem 1.5rem;
    padding: 0;
}

.context-variables ul:last-child {
    margin-bottom: 0;
}

.context-variables li {
    margin: 0.5rem 0;
    color: var(--text-dark);
}

.context-variables code {
    background: var(--bg-light);
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    font-size: 0.9em;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Courier New', monospace;
    color: var(--primary-color);
    font-weight: 600;
}

/* Perfect For: responsive use-case grid */
.use-case-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}
.use-case {
    background: white;
    padding: 1.25rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    display:flex;
    flex-direction:column;
    gap:0.75rem;
    min-height: 160px;
}
.use-case h3 { margin:0 0 0.5rem 0; font-size:1.05rem; }
.use-case p { margin:0; color:var(--text-light); }

@media (max-width: 600px) {
    .use-case { padding: 1rem; min-height: auto; }
}

/* Quick Start: install steps as responsive cards */
.install-steps {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}
.install-step {
    background: white;
    padding: 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    display:flex;
    flex-direction:column;
    gap:0.75rem;
    width: 100%;
    max-width: 760px;
}
.install-step h3 { margin:0; font-size:1.05rem; }
.install-step pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 1rem;
    border-radius: var(--radius);
    overflow: auto;
    font-size: 0.95rem;
    line-height: 1.5;
    border: 1px solid rgba(255, 255, 255, 0.04);
}
.install-step .note { margin-top:0.5rem; color:var(--text-light); font-size:0.95rem; text-align:center; }

/* center CTA under quick-start and give breathing room */
.quick-start .cta-center { margin-top:1.5rem; }

@media (max-width: 700px) {
    .install-step { max-width: 100%; }
}

/* Improved layout for See It In Action: two-column grid on desktop */
.code-example .example-grid{
    display:grid;
    grid-template-columns: 1fr;
    gap:1.25rem;
    align-items:start;
}
/* Place tabs full-width above preview */
.code-example .tabs-column { grid-column: 1 / -1; }
.code-example .tabs { display:flex; flex-direction:row; gap:0.5rem; border-bottom:2px solid var(--border-color); padding-bottom:0.5rem; justify-content:center; overflow:auto; }
.code-example .tabs .tab { padding:0.6rem 1rem; border-radius:6px; background:transparent; color:var(--text-light); }
.code-example .preview-column .tab-content pre { padding:1.25rem; font-size:0.95rem; }

/* Reduce pre padding on small screens for better fit */
@media (max-width: 768px) {
    .tab-content pre { padding: 1rem; font-size: 0.92rem; line-height: 1.45; }
    .code-example .tabs { justify-content:flex-start; }
}

/* CTA Section */
.cta-section {
    padding: var(--section-vertical) 0;
    background: white;
    text-align: center;
}

.cta-section h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.cta-section p {
    font-size: 1.25rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}


/* Content Section */
.content-section {
    padding: var(--section-vertical) 0;
}

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

.placeholder h2 {
    margin-bottom: 1.5rem;
}

.placeholder ul {
    text-align: left;
    margin-top: 2rem;
    line-height: 2;
}

.placeholder a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.placeholder a:hover {
    text-decoration: underline;
}

/* Footer */
.site-footer {
    background: var(--text-dark);
    color: white;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
}

.footer-section p {
    color: rgba(255,255,255,0.8);
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    text-align: center;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.7);
}

.footer-bottom a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
}

.footer-bottom a:hover {
    text-decoration: underline;
}

.version {
    margin-top: 0.5rem;
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero .tagline {
        font-size: 1.25rem;
    }
    
    .hero .description {
        font-size: 1.1rem;
    }
    
    .nav-links {
        gap: 1rem;
        font-size: 0.9rem;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
    }
    :root { --section-vertical: 2.5rem; }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
    
    .hero {
        padding: 4rem 0;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .tabs {
        flex-direction: column;
        border-bottom: none;
    }
    
    .tab {
        border-bottom: 2px solid var(--border-color);
        margin-bottom: 0;
    }
    
    .tab.active {
        border-bottom-color: var(--primary-color);
    }
}

.site-dark {
    background: #0b1220;
    color: #dbeafe;
}

.site-dark .hero {
    /* Darker hero for site-wide dark mode (keeps the original hue, deeper tones) */
    background: linear-gradient(135deg, #2b2f78 0%, #36224f 100%);
    color: #e9f0ff;
}

/* Header slightly darker than the hero to provide separation and anchor the top */
.site-dark .site-header {
    /* Translucent header with gradient tint */
    background: linear-gradient(135deg, rgba(31, 35, 79, 0.75) 0%, rgba(41, 25, 59, 0.75) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.45);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.site-dark .logo, .site-dark .nav-links a { color: #dbeafe; }
.site-dark .nav-links a { opacity: 0.95; }
.site-dark .hamburger span { background-color: #dbeafe; }
.site-dark .btn-primary { background: var(--primary-color); color: white; }
.site-dark .btn-secondary { background: transparent; color: #dbeafe; border-color: rgba(255,255,255,0.12); }

/* make section/ card backgrounds dark where they were white */
.site-dark .feature-card,
.site-dark .use-case,
.site-dark .install-step,
.site-dark .arch-feature,
.site-dark .intro-features li {
    background: #0f1724;
    border: 1px solid rgba(255,255,255,0.03);
    color: #cbd5e1;
}
.site-dark .feature-card h3,
.site-dark .arch-feature strong,
.site-dark .use-case h3 { color: #e6eefc; }
.site-dark .feature-card p,
.site-dark .use-case p,
.site-dark .install-step p,
.site-dark .arch-feature p { color: #a8b3c7; }
.site-dark a { color: #8ab4ff; }
.site-dark .site-footer { background: #071028; color: rgba(255,255,255,0.85); }
.site-dark .comparison-table thead th { background: rgba(0,0,0,0.25); }

/* Dark mode mobile nav overlay */
@media (max-width: 768px) {
    .site-dark .nav-links {
        background: rgba(11, 18, 32, 0.98);
        box-shadow: -2px 0 12px rgba(0,0,0,0.4);
    }
    .site-dark .nav-links a,
    .site-dark .nav-links .nav-coming-soon {
        border-bottom: 1px solid rgba(255,255,255,0.08);
    }
    .site-dark .nav-links a:hover {
        background-color: rgba(255,255,255,0.06);
    }
}

/* Make How It Works steps match other dark cards */
.site-dark .how-it-works .step {
    background: #0f1724;
    border: 1px solid rgba(255,255,255,0.03);
    color: #cbd5e1;
    box-shadow: none;
}
.site-dark .how-it-works .step-content p {
    color: #a8b3c7;
}
.site-dark .how-it-works .step-number {
    background: var(--primary-color);
    color: #ffffff;
}

/* Ensure sections that used explicit white backgrounds become transparent/dark */
.site-dark .features { background: transparent; }
.site-dark .code-example { background: transparent; }
.site-dark .quick-start { background: transparent; }
.site-dark .use-cases { background: transparent; }
.site-dark .htmx-integration { background: transparent; }

.site-dark .htmx-feature,
.site-dark .htmx-example {
    background: #0f1724;
    border: 1px solid rgba(255,255,255,0.03);
    color: #cbd5e1;
}

.site-dark .htmx-feature h3 {
    color: #8ab4ff;
}

.site-dark .htmx-feature code {
    background: rgba(0,0,0,0.3);
    color: #e6eefc;
}

.site-dark .code-column h4 {
    color: #a8b3c7;
}

.site-dark .htmx-note {
    background: rgba(8, 47, 73, 0.6);
    border-left-color: #8ab4ff;
    color: #cbd5e1;
}

.site-dark .htmx-note strong {
    color: #8ab4ff;
}

.site-dark .variables-table {
    background: #0f1724;
    border: 1px solid rgba(255,255,255,0.03);
}

.site-dark .variables-table thead th {
    background: var(--primary-color);
}

.site-dark .variables-table tbody td {
    border-bottom-color: rgba(255,255,255,0.06);
    color: #cbd5e1;
}

.site-dark .variables-table code {
    background: rgba(0,0,0,0.3);
    color: #e6eefc;
}

.site-dark .next-steps {
    background: transparent;
}

.site-dark .next-step-card {
    background: #0f1724;
    border: 1px solid rgba(255,255,255,0.03);
    color: #cbd5e1;
}

.site-dark .next-step-card h3 {
    color: #e6eefc;
}

.site-dark .next-step-card p {
    color: #a8b3c7;
}

.site-dark .ssr-explanation,
.site-dark .context-variables {
    background: #0f1724;
    border-color: rgba(255,255,255,0.06);
}

.site-dark .ssr-explanation h3,
.site-dark .context-variables h4 {
    color: #8ab4ff;
}

.site-dark .context-variables li {
    color: #cbd5e1;
}

.site-dark .context-variables code {
    background: rgba(0,0,0,0.3);
    color: #8ab4ff;
}


/* Architecture section: grid for arch features */
.arch-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}
.arch-feature {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}
.arch-feature strong { display:block; margin-bottom:0.5rem; color:var(--text-dark); }

/* Comparison table styling */
.comparison-table-wrapper { overflow-x: auto; margin-top:1rem; margin-bottom:1.25rem; }
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
    box-shadow: var(--shadow);
    border-radius: var(--radius);
    overflow: hidden;
}
.comparison-table th, .comparison-table td {
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--border-color);
    vertical-align: middle;
    text-align: left;
    font-size: 0.875rem;
}
.comparison-table thead th {
    background: var(--primary-color);
    color: white;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.85rem 0.75rem;
    border-bottom: 3px solid var(--primary-dark);
    position: relative;
}
.comparison-table thead th::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-dark), var(--primary-color));
}
.site-dark .comparison-table thead th {
    background: linear-gradient(135deg, #1e3a8a 0%, #0066CC 100%);
    border-bottom-color: #1e3a8a;
}

/* Feature column styling */
.comparison-table .feature-col {
    font-weight: 600;
    width: 20%;
    white-space: nowrap;
}

/* Facet column highlight - make it stand out */
.comparison-table .facet-col {
    background: rgba(0, 102, 204, 0.12);
    font-weight: 600;
    border-left: 3px solid var(--primary-color);
    border-right: 3px solid var(--primary-color);
}
.comparison-table thead .facet-col {
    background: var(--primary-dark);
    border-left-color: rgba(255, 255, 255, 0.3);
    border-right-color: rgba(255, 255, 255, 0.3);
}
.site-dark .comparison-table .facet-col {
    background: rgba(102, 126, 234, 0.15);
    border-left-color: #667eea;
    border-right-color: #667eea;
}
.site-dark .comparison-table thead .facet-col {
    background: linear-gradient(135deg, #1e3a8a 0%, #0052A3 100%);
}

/* Zebra rows for better readability */
.comparison-table tbody tr:nth-child(odd) {
    background: rgba(0,0,0,0.02);
}
.comparison-table tbody tr:nth-child(even) {
    background: white;
}
.site-dark .comparison-table tbody tr:nth-child(odd) {
    background: rgba(255,255,255,0.02);
}
.site-dark .comparison-table tbody tr:nth-child(even) {
    background: rgba(0,0,0,0.1);
}

/* Indicator symbols */
.comparison-table .indicator {
    display: inline-block;
    font-weight: 700;
    font-size: 1.1em;
    margin-right: 0.5rem;
    width: 1.2em;
}

/* Positive/negative/neutral indicators */
.comparison-table .positive .indicator {
    color: #10B981;
}
.comparison-table .negative .indicator {
    color: #EF4444;
}
.comparison-table .neutral .indicator {
    color: #F59E0B;
}

/* Product icons in comparison table */
.product-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    margin-right: 0.5rem;
    font-size: 1.25rem;
    vertical-align: middle;
}

.product-icon.facet-logo {
    background: var(--primary-color);
    color: white;
    border-radius: 0;
    font-weight: 700;
    font-size: 0.875rem;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    width: 1.6rem;
    height: 1.6rem;
}

/* Cell text colors */
.comparison-table td {
    color: var(--text-dark);
}
.comparison-table td strong { 
    color: currentColor; 
    font-weight: 700; 
}

/* Dark theme adjustments */
.site-dark .comparison-table th,
.site-dark .comparison-table td {
    color: #cbd5e1;
    border-color: rgba(255,255,255,0.05);
}

/* Space above the comparison note so it's not flush with the table */
.comparison-note { margin-top: 1.25rem; color: var(--text-light); }

@media (max-width: 760px) {
    .comparison-table { min-width: 600px; }
    .comparison-table th, .comparison-table td { padding: 0.6rem 0.75rem; }
}

/* Reduce top spacing specifically for Architecture section */
.architecture { padding-top: 1.25rem; }

/* Prism.js custom integration */
pre[class*="language-"] {
    background: #2d2d2d !important;
    border-radius: var(--radius);
    margin: 0;
}

code[class*="language-"] {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Courier New', monospace;
    text-shadow: none;
}

/* Ensure Prism toolbar doesn't interfere if plugins are added later */
.code-toolbar {
    position: relative;
}

/* Override Prism line height to match our design */
pre[class*="language-"] > code {
    line-height: 1.5;
}

/* Note box for documentation */
.note-box {
    background: var(--code-bg);
    border-left: 4px solid var(--primary-color);
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 4px;
}

.note-box h4 {
    margin-top: 0;
    color: var(--primary-color);
}

.note-box ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.note-box li {
    margin: 0.5rem 0;
}

.note-box p:last-child {
    margin-bottom: 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Visual Banner - REST to HTML Transformation */
.visual-banner {
    padding: 2rem 0;
}

.visual-banner-box {
    max-width: 1200px;
    margin: 0 auto;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #1a1a2e 100%);
    border-radius: var(--radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

.visual-banner-box::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(102, 126, 234, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 70% 50%, rgba(118, 75, 162, 0.08) 0%, transparent 50%);
    animation: banner-pulse 8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes banner-pulse {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.1) rotate(5deg); }
}

.banner-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3rem;
    position: relative;
    z-index: 1;
    padding: 3rem 2rem;
}

/* API Side */
.api-side {
    flex: 1;
}

.api-label {
    font-size: 0.875rem;
    font-weight: 700;
    color: #667eea;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.code-block {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 8px;
    padding: 1.5rem;
    font-family: 'Fira Code', 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.8;
    color: #e0e0e0;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.json-key { color: #bb86fc; }
.json-string { color: #4ade80; }
.json-number { color: #fbbf24; }

/* Transform Arrow */
.transform-arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.arrow-icon {
    font-size: 3rem;
    color: #667eea;
    animation: arrow-slide 2s ease-in-out infinite;
}

@keyframes arrow-slide {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(10px); }
}

.transform-label {
    font-size: 0.875rem;
    font-weight: 700;
    color: #667eea;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(102, 126, 234, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid rgba(102, 126, 234, 0.4);
    white-space: nowrap;
}

.template-note {
    font-size: 0.75rem;
    color: #a0a0a0;
    font-style: italic;
    text-align: center;
    max-width: 140px;
}

/* HTML Side */
.html-side {
    flex: 1;
}

.html-label {
    font-size: 0.875rem;
    font-weight: 700;
    color: #4ade80;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.html-preview {
    background: rgba(255, 255, 255, 0.828);
    border-radius: 8px;
    padding: 1.5rem;
    color: #1a1a2e;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    min-height: 180px;
}

.html-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0 0 0.5rem 0;
    color: #1a1a2e;
}

.html-meta {
    font-size: 0.875rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.html-body {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #333;
}

/* Responsive adjustments for banner */
@media (max-width: 768px) {
    .banner-wrapper {
        flex-direction: column;
        gap: 2rem;
    }
    
    .transform-arrow {
        transform: rotate(90deg);
    }
}

/* Tech Stack Section */
.stack-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    max-width: 1100px;
    margin: 0 auto;
}

@media (max-width: 992px) {
    .stack-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 640px) {
    .stack-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 400px) {
    .stack-grid {
        grid-template-columns: 1fr;
    }
    
    .arrow-icon {
        font-size: 2rem;
    }
    
    .code-block {
        font-size: 0.75rem;
    }
}
