:root {
    /* Core brand fonts — loaded async from base.html */
    --font-heading: 'Outfit', system-ui, sans-serif;
    --font-body: 'Onest', system-ui, sans-serif;

    /* Radii */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-pill: 9999px;

    /* Transitions */
    --transition-fast: 0.15s ease-out;
    --transition-smooth: 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    --shadow-hover: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Core Theme Variables */
:root {
    --primary: #FF523D;
    --primary-hover: #E54533;
    --secondary: #05C46B;
    --bg-color: #FFFFFF;
    --bg-surface: #F8F9FA;
    --bg-nav: rgba(255, 255, 255, 0.85);
    --text-main: #111111;
    --text-muted: #6B7280;
    --border-color: #E5E7EB;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background-color var(--transition-smooth), color var(--transition-smooth);
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

/* Typography */
h1,
h2,
h3,
h4,
h5 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--text-main);
}

.title-huge {
    font-size: clamp(3rem, 6vw + 1rem, 5rem);
    font-weight: 900;
    letter-spacing: -0.04em;
    margin-bottom: 1rem;
}

.text-muted {
    color: var(--text-muted);
}

/* Header & Nav */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background-color: var(--bg-nav);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
}

@media (max-width: 600px) {
    .site-header {
        padding: 0.8rem 0;
        /* Slightly more balanced padding */
    }
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    /* Added for mobile */
    gap: 1rem;
    /* Added for mobile */
}

@media (max-width: 600px) {
    .nav-container {
        padding: 0 0.75rem;
        justify-content: space-between;
        /* Back to spread to save vertical space */
        gap: 0.25rem;
    }
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

@media (max-width: 600px) {
    .logo {
        font-size: 1.25rem;
        /* Slightly smaller text */
        gap: 0.5rem;
    }
}

.logo-img {
    height: 42px;
    /* Balanced size for nav */
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.05));
    transition: transform var(--transition-smooth);
}

@media (max-width: 600px) {
    .logo-img {
        height: 32px;
        /* Smaller icon on mobile */
    }
}

.logo:hover .logo-img {
    transform: rotate(-5deg) scale(1.1);
}

.logo span {
    color: var(--primary);
}

.hero-logo {
    display: block;
    margin: 0 auto 2rem;
    width: 180px;
    height: auto;
    animation: float 6s ease-in-out infinite;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.lang-toggle {
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    position: relative;
    top: -2px;
    /* Nudge up for perfect alignment */
}

@media (max-width: 600px) {
    .nav-links {
        gap: 0.5rem;
        /* Tighter links */
        font-size: 0.85rem;
    }
}

.nav-link {
    font-weight: 500;
    color: var(--text-muted);
}

.nav-link:hover {
    color: var(--text-main);
}

/* Inputs & Toggles */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1.25rem;
    transition: color var(--transition-fast);
}

.theme-toggle:hover {
    color: var(--text-main);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.75rem;
    font-weight: 600;
    border-radius: var(--radius-pill);
    transition: all var(--transition-smooth);
    border: none;
    cursor: pointer;
    font-size: 1.125rem;
}

.btn-primary {
    background-color: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(255, 82, 61, 0.25);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--bg-surface);
    transform: translateY(-2px);
}

/* Layout Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    padding: 8rem 0;
}

@media (max-width: 600px) {
    .section {
        padding: 4rem 0;
        /* Half padding on mobile */
    }
}

.text-center {
    text-align: center;
}

/* Hero Section */
.hero {
    padding: 4rem 0 4rem;
    text-align: center;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 2.5rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Marquee / Ticker */
.ticker-wrap {
    width: 100%;
    overflow: hidden;
    background-color: var(--bg-surface);
    padding: 1.5rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.02);
}

.ticker {
    display: inline-flex;
    width: max-content;
    animation: ticker 30s linear infinite;
    gap: 3rem;
    align-items: center;
    padding-right: 3rem;
    /* match gap */
}

.ticker-item {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.25rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

@keyframes ticker {
    0% {
        transform: translate3d(0, 0, 0);
    }

    100% {
        /* Move exactly half the distance */
        transform: translate3d(-50%, 0, 0);
    }
}

/* Bento Grid */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.5rem;
}

.bento-card {
    background-color: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    transition: all var(--transition-smooth);
    display: flex;
    flex-direction: column;
}

.bento-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary);
}

.bento-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.bento-card.large {
    grid-column: span 8;
}

.bento-card.small {
    grid-column: span 4;
}

.bento-card.half {
    grid-column: span 6;
}

@media (max-width: 900px) {

    .bento-card.large,
    .bento-card.small,
    .bento-card.half {
        grid-column: span 12;
    }
}

/* Setup Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-pill);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.badge-mint {
    background-color: rgba(5, 196, 107, 0.15);
    color: var(--secondary);
}

.badge-coral {
    background-color: rgba(255, 82, 61, 0.15);
    color: var(--primary);
}

/* Markdown Content Styling */
.md-content {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.125rem;
    color: var(--text-main);
    padding-bottom: 6rem;
}

.md-content>* {
    margin-bottom: 1.5rem;
}

.md-content>*:first-child {
    margin-top: 0;
}

.md-content h1 {
    font-size: 3rem;
    margin-bottom: 2rem;
    margin-top: 3rem;
}

.md-content h2 {
    font-size: 2rem;
    margin-top: 2.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.md-content h3 {
    font-size: 1.5rem;
    margin-top: 2rem;
}

.md-content ul,
.md-content ol {
    padding-left: 2rem;
}

.md-content li {
    margin-bottom: 0.5rem;
}

.md-content a {
    color: var(--primary);
    font-weight: 500;
    border-bottom: 2px solid transparent;
}

.md-content a:hover {
    border-color: var(--primary);
}

.md-content blockquote {
    border-left: 4px solid var(--secondary);
    padding-left: 1.5rem;
    font-style: italic;
    color: var(--text-muted);
    background-color: var(--bg-surface);
    padding: 1.5rem;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.md-content code {
    font-family: monospace;
    background-color: var(--bg-surface);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
    color: var(--primary);
}

.md-content pre {
    background-color: #1A1D24;
    color: #F9FAFB;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin: 2rem 0;
}

.md-content pre code {
    background-color: transparent;
    color: inherit;
    padding: 0;
}

/* Footer */
footer {
    text-align: center;
    padding: 4rem 0;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    margin-top: auto;
}

/* Documentation Layout */
.docs-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
    min-height: calc(100vh - 200px);
}

@media (max-width: 768px) {
    .docs-layout {
        grid-template-columns: 1fr;
        padding: 2rem 1rem;
        gap: 1rem;
        /* Reduced gap to remove 'empty line' feel */
    }
}

.docs-sidebar {
    position: sticky;
    top: 100px;
    align-self: start;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

@media (max-width: 768px) {
    .docs-sidebar {
        padding: 0.75rem 1rem;
        /* Balanced mobile padding */
        border-radius: var(--radius-md);
        margin-bottom: 0.5rem;
    }
}

.docs-sidebar-title {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

@media (max-width: 768px) {
    .docs-sidebar-title {
        margin-bottom: 0;
        padding-bottom: 0;
        border-bottom: none;
        line-height: 1;
        /* Ensure no extra height */
        display: flex;
        align-items: center;
    }
}

.docs-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.docs-nav-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.docs-nav-link:hover {
    color: var(--text-main);
    background-color: rgba(0, 0, 0, 0.03);
}

.docs-nav-link.active {
    color: var(--primary);
    background-color: rgba(255, 82, 61, 0.1);
}

.docs-nav-order {
    font-family: monospace;
    opacity: 0.5;
    margin-right: 0.5rem;
    font-size: 0.9em;
}

.docs-content {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem 3rem;
    box-shadow: var(--card-shadow);
}

.docs-content .md-content {
    margin: 0;
    padding: 0;
    max-width: none;
}