/* Color system */
:root {
    --bg: #0b1220;
    --bg-2: #0f1830;
    --text: #e9eefb;
    --muted: #b7c0d9;
    --primary: #4ea1ff;
    --primary-2: #6b5bff;
    --glass: rgba(255, 255, 255, 0.06);
    --surface: var(--bg-2);
    --card: rgba(255, 255, 255, 0.04);
    --border: rgba(255, 255, 255, 0.08);
    --ring: rgba(78, 161, 255, 0.55);
    --info: #4ea1ff;
    --success: #2ecc71;
    --warning: #f1c40f;
    --danger: #e74c3c;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 2px 10px rgba(0,0,0,0.25);
    --shadow-md: 0 6px 24px rgba(0,0,0,0.30);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.40);
    --gap-sm: 12px;
    --gap-md: 16px;
    --gap-lg: 24px;
}

/* Base */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
}

[hidden] { display: none !important; }

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

/* Background image with fading overlay */
.bg-overlay {
    position: fixed;
    inset: 0;
    background: url('/images/background-min.png') center/cover no-repeat fixed;
    z-index: -2;
}
.bg-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(80% 60% at 60% 40%, rgba(10, 20, 50, 0.0) 0%, rgba(10, 20, 50, 0.35) 40%, rgba(10, 20, 50, 0.7) 100%),
                linear-gradient(180deg, rgba(7, 10, 20, 0.35) 0%, rgba(7, 10, 20, 0.85) 80%);
    z-index: -1;
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    padding: 8px 0;
    backdrop-filter: saturate(120%) blur(8px);
    background: linear-gradient(180deg, rgba(15, 24, 48, 0.9), rgba(15, 24, 48, 0.35));
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.site-header .container {
    max-width: none;
    margin: 0;
    padding: 0 24px 0 16px;
}
.header-inner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    min-height: 48px;
}
.brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    line-height: 0;
    padding: 4px;
    border-radius: var(--radius-sm);
}
.brand img {
    height: 32px;
    width: auto;
    display: block;
}
.main-nav {
    display: inline-flex;
    align-items: center;
}
.main-nav a {
    color: var(--text);
    text-decoration: none;
    margin-left: 28px;
    opacity: 0.85;
}
.main-nav a.is-active {
    opacity: 1;
    font-weight: 600;
}
.main-nav a:hover { opacity: 1; }

/* Hero */
.hero {
    display: grid;
    align-items: end;
    min-height: calc(100vh - 72px);
}
.hero-inner {
    padding: 72px 0 96px;
}
.headline {
    margin: 0 0 28px;
    font-size: clamp(28px, 4.2vw, 56px);
    line-height: 1.1;
    font-weight: 800;
    text-shadow: 0 6px 22px rgba(0,0,0,0.35);
}
.cta {
    display: inline-block;
    padding: 14px 22px;
    border-radius: 10px;
    color: white;
    text-decoration: none;
    background: linear-gradient(90deg, var(--primary), var(--primary-2));
    box-shadow: 0 10px 30px rgba(78,161,255,0.35);
    font-weight: 700;
}
.cta:hover { filter: brightness(1.05); }

/* Sections */
.section { padding: 72px 0; }
.section-head { margin-bottom: 28px; }
.section-head h2 { margin: 0 0 6px; font-size: clamp(22px, 3vw, 32px); }
.section-sub { margin: 0; color: var(--muted); }

/* Market Overview */
.section-overview {
    background: linear-gradient(180deg, rgba(11, 17, 32, 0.85), rgba(7, 10, 20, 0.95));
    position: relative;
    overflow: hidden;
}
.section-overview::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(70% 70% at 15% 10%, rgba(120, 160, 255, 0.18), transparent 65%),
        radial-gradient(80% 80% at 85% 10%, rgba(234, 76, 137, 0.18), transparent 70%);
    opacity: 0.9;
    pointer-events: none;
}
.section-overview .container {
    position: relative;
    z-index: 1;
}
.landing-overview {
    display: flex;
    flex-direction: column;
    gap: 48px;
}
.overview-status {
    padding: 1rem 1.25rem;
    border-radius: 18px;
    border-left: 4px solid var(--info);
    background: rgba(78, 161, 255, 0.12);
    color: var(--text);
    font-weight: 500;
    box-shadow: 0 18px 38px rgba(5, 10, 28, 0.28);
}
.overview-status.is-warning {
    border-color: var(--warning);
    background: rgba(241, 196, 15, 0.16);
    color: #fff6d0;
}
.overview-status.is-error {
    border-color: var(--danger);
    background: rgba(231, 76, 60, 0.18);
    color: #ffe4e0;
}
.landing-overview .overview-hero {
    margin-top: 0;
    padding: clamp(1.75rem, 2vw + 1.6rem, 2.8rem);
    border-radius: 28px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.92) 0%, rgba(51, 65, 160, 0.6) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 34px 70px rgba(4, 8, 24, 0.38);
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: clamp(1.5rem, 3vw, 2.75rem);
    position: relative;
    overflow: hidden;
}
.landing-overview .overview-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(120% 120% at 10% 10%, rgba(80, 119, 255, 0.24), transparent 65%),
        radial-gradient(80% 80% at 85% 15%, rgba(234, 76, 137, 0.18), transparent 70%);
    pointer-events: none;
    mix-blend-mode: screen;
}
.landing-overview .overview-hero__content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    flex: 1 1 360px;
    min-width: 280px;
}
.landing-overview .hero-kicker {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.32em;
    color: rgba(255, 255, 255, 0.65);
    margin: 0;
}
.landing-overview .hero-title {
    font-size: clamp(1.9rem, 2.6vw, 2.6rem);
    margin: 0;
    font-weight: 700;
    color: #ffffff;
}
.landing-overview .hero-description {
    margin: 0;
    max-width: 38ch;
    color: rgba(232, 233, 241, 0.85);
    line-height: 1.6;
}
.landing-overview .hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}
.landing-overview .hero-chip,
.landing-overview .module-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.92);
    text-transform: uppercase;
    backdrop-filter: blur(8px);
}
.landing-overview .hero-chip--status,
.landing-overview .module-chip--status {
    background: rgba(76, 201, 240, 0.18);
    border-color: rgba(76, 201, 240, 0.4);
}
.landing-overview .hero-chip--status.is-bull,
.landing-overview .module-chip--glass.is-bull,
.landing-overview .module-chip--status.is-bull {
    background: rgba(14, 201, 122, 0.18);
    border-color: rgba(14, 201, 122, 0.5);
    color: #d3ffe9;
}
.landing-overview .hero-chip--status.is-bear,
.landing-overview .module-chip--glass.is-bear,
.landing-overview .module-chip--status.is-bear {
    background: rgba(233, 69, 96, 0.22);
    border-color: rgba(233, 69, 96, 0.48);
    color: #ffd8de;
}
.landing-overview .hero-chip--status.is-waxing,
.landing-overview .module-chip--status.is-waxing {
    background: rgba(118, 75, 162, 0.24);
    border-color: rgba(118, 75, 162, 0.5);
    color: #e8dbff;
}
.landing-overview .hero-chip--status.is-waning,
.landing-overview .module-chip--status.is-waning {
    background: rgba(26, 102, 238, 0.22);
    border-color: rgba(26, 102, 238, 0.5);
    color: #dbe8ff;
}
.landing-overview .hero-chip--muted {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    color: rgba(214, 219, 241, 0.9);
}
.landing-overview .overview-hero__metrics {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    flex: 1 1 320px;
    justify-content: flex-end;
}
.landing-overview .metric-tile {
    background: linear-gradient(160deg, rgba(24, 32, 58, 0.88) 0%, rgba(9, 14, 33, 0.72) 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    padding: 1.1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    box-shadow: 0 18px 34px rgba(4, 6, 18, 0.32);
    backdrop-filter: blur(12px);
    min-width: 160px;
    flex: 1 1 160px;
}
.landing-overview .metric-label {
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.32em;
    color: rgba(199, 205, 229, 0.72);
}
.landing-overview .metric-value {
    font-size: clamp(1.6rem, 2.2vw, 2rem);
    font-weight: 700;
    color: #ffffff;
    line-height: 1.1;
}
.landing-overview .metric-value--accent {
    color: #8ad6ff;
}
.landing-overview .metric-caption {
    font-size: 0.82rem;
    color: rgba(212, 217, 236, 0.7);
    letter-spacing: 0.08em;
}
.landing-overview .overview-layout {
    display: grid;
    gap: 2rem;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
}
.landing-overview .overview-column {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}
.landing-overview .module {
    background: rgba(15, 22, 38, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 22px;
    padding: clamp(1.5rem, 1.2vw + 1.3rem, 2rem);
    box-shadow: 0 22px 45px rgba(5, 8, 20, 0.28);
    backdrop-filter: blur(14px);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.landing-overview .module--lunar {
    background: linear-gradient(150deg, rgba(11, 16, 30, 0.9) 0%, rgba(37, 51, 109, 0.72) 100%);
    box-shadow: 0 26px 48px rgba(9, 12, 28, 0.35);
}
.landing-overview .module-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}
.landing-overview .module-kicker {
    margin: 0;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.28em;
    color: rgba(167, 176, 212, 0.68);
}
.landing-overview .module-header h3 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 600;
    color: #ffffff;
}
.landing-overview .module-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.landing-overview .module-chip--outline {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(229, 233, 246, 0.9);
}
.landing-overview .module-chip--glass {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.28);
}
.landing-overview .module-body {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.landing-overview .module-subgrid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.1rem;
}
.landing-overview .module-card {
    background: rgba(9, 14, 28, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 1rem 1.1rem;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}
.landing-overview .module-card h4 {
    margin: 0 0 0.75rem 0;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: rgba(176, 186, 226, 0.9);
}
.landing-overview .data-stack .data-item,
.landing-overview .module .data-item {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0;
    border: none;
}
.landing-overview .module .data-label {
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(173, 181, 214, 0.68);
}
.landing-overview .module .data-value {
    font-size: 1.05rem;
    font-weight: 600;
    color: #ffffff;
}
.landing-overview .module .data-value.positive {
    color: #4ddfad;
}
.landing-overview .module .data-value.negative {
    color: #ff7d7d;
}
.landing-overview .module-metrics--pill {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}
.landing-overview .metric-pill {
    background: rgba(10, 14, 28, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 0.9rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}
.landing-overview .metric-pill-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.28em;
    color: rgba(189, 197, 226, 0.68);
}
.landing-overview .metric-pill-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: #ffffff;
}
.landing-overview .cycle-timeline {
    list-style: none;
    margin: 0;
    padding: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    padding-left: 1.4rem;
}
.landing-overview .cycle-timeline-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    position: relative;
}
.landing-overview .cycle-dot {
    position: absolute;
    left: -1.4rem;
    top: 0.15rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(136, 157, 255, 0.9);
    box-shadow: 0 0 12px rgba(136, 157, 255, 0.55);
}
.landing-overview .cycle-dot--pivot {
    background: rgba(255, 206, 93, 0.9);
    box-shadow: 0 0 12px rgba(255, 206, 93, 0.45);
}
.landing-overview .cycle-dot--end {
    background: rgba(234, 76, 137, 0.9);
    box-shadow: 0 0 12px rgba(234, 76, 137, 0.45);
}
.landing-overview .cycle-label {
    display: block;
    font-size: 0.78rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(182, 192, 224, 0.72);
}
.landing-overview .cycle-value {
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
}
.landing-overview .insight-banner {
    background: linear-gradient(135deg, rgba(104, 132, 255, 0.25) 0%, rgba(136, 96, 208, 0.25) 100%);
    border: 1px solid rgba(136, 157, 255, 0.35);
    color: #e4e8ff;
    border-radius: 16px;
    padding: 1rem 1.25rem;
    font-weight: 600;
    line-height: 1.6;
}
.landing-overview .module-body--lunar {
    gap: 1.75rem;
}
.landing-overview .moon-display {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
}
.landing-overview .moon-display__visual {
    width: 140px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.landing-overview .moon-display__visual > * {
    width: 100% !important;
    height: 100% !important;
}
.landing-overview .moon-display__stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.9rem;
}
.landing-overview .moon-display__stats .data-item {
    background: rgba(8, 12, 26, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 0.85rem 1rem;
}
.landing-overview .lunar-brief .module-card {
    background: rgba(8, 11, 24, 0.55);
}
.landing-overview .cta-row {
    margin-top: 0.75rem;
    display: flex;
    justify-content: flex-end;
}
.landing-overview .cta-row .btn {
    border-color: rgba(255, 255, 255, 0.32);
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.18em;
}
.landing-overview .cta-row .btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

@media (max-width: 1080px) {
    .landing-overview .overview-hero {
        padding: 2rem;
    }
    .landing-overview .overview-hero__metrics {
        justify-content: flex-start;
    }
    .landing-overview .overview-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .landing-overview .overview-hero {
        padding: 1.6rem 1.4rem;
        border-radius: 22px;
        gap: 1.5rem;
    }
    .landing-overview .hero-description {
        max-width: 100%;
    }
    .landing-overview .moon-display {
        flex-direction: column;
        align-items: flex-start;
    }
    .landing-overview .moon-display__visual {
        width: 110px;
        height: 110px;
    }
}

.metric-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    border: 1px solid transparent;
    margin-left: 6px;
}
.metric-badge.positive {
    color: #22c55e;
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.35);
}
.metric-badge.negative {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.35);
}

.moon-disk {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #f8f8f8 0%, #e8e8e8 40%, #cfcfcf 100%);
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 6px rgba(0,0,0,0.25), 0 2px 6px rgba(0,0,0,0.4);
}
.moon-disk::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 0%;
    background: #0f1419;
    filter: brightness(0.7);
    box-shadow: inset 0 0 8px rgba(0,0,0,0.6);
}

.module .data-value.positive { color: #4ddfad; }
.module .data-value.negative { color: #ff7d7d; }

/* Indicators */
.section-indicators { background: linear-gradient(180deg, rgba(10,14,24,0.2), rgba(10,14,24,0.45)); }
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
}
.card {
    padding: 18px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}
.card h3 { margin: 0 0 8px; font-size: 18px; }
.card p { margin: 0 0 12px; color: var(--muted); }
.card .stat { font-weight: 700; color: var(--primary); }

/* Footer */
.site-footer {
    border-top: 1px solid rgba(255,255,255,0.06);
    background: rgba(10,14,24,0.6);
    backdrop-filter: blur(6px);
}
.footer-inner {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 14px;
}

/* Utilities */
.br-md { display: none; }
@media (min-width: 768px) { .br-md { display: inline; } }



/* Typography */
h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 800; }
h1 { font-size: clamp(28px, 4.2vw, 48px); line-height: 1.1; }
h2 { font-size: clamp(22px, 3.2vw, 32px); }
h3 { font-size: 22px; }
h4 { font-size: 18px; }
p { margin: 0; }
small, .muted { color: var(--muted); }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace; }
pre { background: rgba(255,255,255,0.04); border: 1px solid var(--border); padding: 12px; border-radius: var(--radius-sm); overflow: auto; }
blockquote { margin: 0; padding: 12px 16px; border-left: 3px solid var(--primary); background: rgba(255,255,255,0.04); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
    transition: transform 120ms ease, filter 120ms ease, background 120ms ease;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }

.btn-primary { background: linear-gradient(90deg, var(--primary), var(--primary-2)); border-color: transparent; box-shadow: 0 6px 22px rgba(78,161,255,0.35); }
.btn-secondary { background: var(--surface); }
.btn-ghost { background: transparent; border-color: var(--border); }
.btn-success { background: linear-gradient(90deg, var(--success), #1abc9c); border-color: transparent; }
.btn-warning { background: linear-gradient(90deg, var(--warning), #f39c12); border-color: transparent; color: #17202a; }
.btn-danger { background: linear-gradient(90deg, var(--danger), #c0392b); border-color: transparent; }
.btn-link { background: transparent; border-color: transparent; color: var(--primary); padding: 0; }

.btn-sm { padding: 6px 10px; font-size: 12px; }
.btn-lg { padding: 14px 22px; font-size: 16px; border-radius: var(--radius-md); }

/* Badges */
.badge { display: inline-block; padding: 4px 8px; border-radius: 999px; border: 1px solid var(--border); background: var(--card); font-size: 12px; font-weight: 700; }
.badge-info { background: rgba(78,161,255,0.12); color: var(--info); border-color: rgba(78,161,255,0.35); }
.badge-success { background: rgba(46,204,113,0.12); color: var(--success); border-color: rgba(46,204,113,0.35); }
.badge-warning { background: rgba(241,196,15,0.12); color: var(--warning); border-color: rgba(241,196,15,0.35); }
.badge-danger { background: rgba(231,76,60,0.12); color: var(--danger); border-color: rgba(231,76,60,0.35); }

/* Alerts */
.alert { padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--card); }
.alert-info { border-color: rgba(78,161,255,0.35); background: rgba(78,161,255,0.10); }
.alert-success { border-color: rgba(46,204,113,0.35); background: rgba(46,204,113,0.10); }
.alert-warning { border-color: rgba(241,196,15,0.35); background: rgba(241,196,15,0.10); }
.alert-danger { border-color: rgba(231,76,60,0.35); background: rgba(231,76,60,0.10); }

/* Inputs */
.input, .select, .textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
}
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.input:focus, .select:focus, .textarea:focus { outline: 2px solid var(--ring); outline-offset: 2px; }

.field { display: grid; gap: var(--gap-sm); }
.field label { font-size: 12px; color: var(--muted); }

.input-inline { display: flex; gap: var(--gap-sm); align-items: center; }

/* Checkbox, Radio, Switch */
.control { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.control input[type="checkbox"],
.control input[type="radio"] {
    width: 16px; height: 16px; margin: 0;
    accent-color: var(--primary);
}

.switch { position: relative; width: 40px; height: 22px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; transition: background 120ms ease; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; background: white; border-radius: 50%; transition: transform 120ms ease; }
.switch[aria-checked="true"] { background: var(--primary); border-color: transparent; }
.switch[aria-checked="true"]::after { transform: translateX(18px); }

/* Cards */
.card-structured {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    min-width: 0;
    width: 100%;
}
.card-structured > * { margin: 0; }
.card-structured .card-header { padding: 14px 18px; border-bottom: 1px solid var(--border); font-weight: 700; }
.card-structured .card-body { padding: 18px; flex: 1 1 auto; display: flex; flex-direction: column; gap: 8px; }
.card-structured .card-body > * { margin: 0; }
.card-structured .card-footer { padding: 12px 18px; border-top: 1px solid var(--border); color: var(--muted); font-size: 14px; }

/* Tables */
.table-responsive { width: 100%; overflow: auto; border-radius: var(--radius-sm); border: 1px solid var(--border); padding: var(--gap-sm); }
table.table { width: 100%; border-collapse: collapse; min-width: 640px; }
table.table th, table.table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
table.table thead th { color: var(--muted); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }
table.table tbody tr:hover { background: rgba(255,255,255,0.03); }
table.table tbody tr:nth-child(odd) { background: rgba(255,255,255,0.02); }

/* Layout utilities */
.grid { display: grid; gap: var(--gap-md); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.stack-sm > * + * { margin-top: var(--gap-sm); }
.stack-md > * + * { margin-top: var(--gap-md); }
.stack-lg > * + * { margin-top: var(--gap-lg); }

.component-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--gap-md);
    align-items: center;
}
.component-row > * { margin: 0; }

.row { display: flex; gap: var(--gap-md); flex-wrap: wrap; }
.col { flex: 1 1 0; min-width: 220px; }

/* Text utilities */
.text-muted { color: var(--muted); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }

/* Divider */
.divider { height: 1px; background: var(--border); margin: 18px 0; }

/* Demo page helpers */
.theme-section { padding: 36px 0; }
.theme-section h2 { margin-bottom: 8px; }
.demo-card {
    padding: 18px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    min-width: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: var(--gap-md);
}
.demo-card > * { margin: 0; }

/* Theme page (solid dark background, no image) */
.theme-page {
    --bg: #0a0f1a;      /* near-black deep blue */
    --bg-2: #0d1626;    /* slightly lighter for surfaces */
    --card: rgba(255, 255, 255, 0.03);
    --border: rgba(255, 255, 255, 0.08);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.theme-page main { flex: 1 1 auto; }
.theme-page .site-footer {
    margin-top: auto;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 9;
}

.theme-page .site-header {
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    backdrop-filter: none;
    z-index: 10;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    cursor: pointer;
    transition: background 140ms ease, border 140ms ease, filter 140ms ease;
}
.icon-button:hover { filter: brightness(1.08); }
.icon-button svg { width: 16px; height: 16px; fill: currentColor; }

.icon-button.icon-danger {
    color: var(--danger);
}

/* Theme hero */
.theme-content { padding-bottom: 160px; }
.theme-hero {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: 32px;
    align-items: start;
    padding: 32px 0 48px;
}
@media (max-width: 900px) {
    .theme-hero { grid-template-columns: 1fr; }
}
.theme-hero-copy { display: flex; flex-direction: column; gap: 20px; }
.theme-hero-copy p { max-width: 620px; color: var(--muted); font-size: 16px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-highlights {
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 12px;
}
.hero-highlights li {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}
.hero-highlights strong { font-size: 14px; letter-spacing: 0.02em; }
.hero-highlights span { font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }

.hero-card {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 24px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}
.hero-card header { display: flex; flex-direction: column; gap: 8px; }
.hero-card header small { color: var(--muted); text-transform: uppercase; letter-spacing: 0.16em; font-size: 11px; }
.hero-metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 14px;
}
.hero-metric {
    padding: 14px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.hero-metric small { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; }
.hero-metric strong { font-size: 18px; }
.hero-metric span { font-size: 13px; }

.swatch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px;
}
.swatch-card {
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--card);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.swatch-preview {
    height: 96px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.swatch-meta { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.swatch-meta code { font-size: 12px; color: var(--text); }

.token-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
}
.token-block {
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--card);
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: var(--shadow-sm);
}
.token-block h3 { font-size: 16px; }
.token-meta {
    display: grid;
    gap: 10px;
    font-size: 13px;
    color: var(--muted);
}
.token-meta div { display: flex; justify-content: space-between; gap: 12px; }
.token-meta dt { text-transform: uppercase; letter-spacing: 0.12em; font-size: 11px; color: var(--muted); }
.token-meta dd { margin: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace; font-size: 12px; color: var(--text); }

.component-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}
.component-card {
    padding: 24px;
    background: var(--card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.component-card header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.component-card header span { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em; }
.component-card footer { font-size: 13px; color: var(--muted); }
.component-preview { display: flex; flex-direction: column; gap: 12px; }
.component-preview .btn + .btn { margin-left: 0; }

.pattern-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}
.pattern-card {
    padding: 22px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--card);
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.pattern-card ul { margin: 0; padding-left: 18px; color: var(--muted); }

.eyebrow {
    display: inline-block;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 11px;
    color: var(--muted);
}

/* Panel layout for full-width demos */
.has-panel { min-height: 100vh; display: flex; flex-direction: column; }
.panel-layout {
    flex: 1 1 auto;
    display: block;
    min-height: 0;
    position: relative;
}
.nav-panel {
    position: fixed;
    top: 72px;
    bottom: 0;
    left: 0;
    width: 280px;
    background: var(--bg-2);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0;
    transition: transform 220ms ease;
    box-shadow: var(--shadow-md);
    z-index: 8;
    transform: translateX(0);
}
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 24px 24px 12px;
    transition: opacity 200ms ease;
}
.panel-heading { display: flex; flex-direction: column; gap: 4px; }
.panel-heading strong { font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.panel-heading span { font-size: 18px; font-weight: 700; }
.panel-scroll {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 12px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    transition: opacity 200ms ease;
}
.panel-layout + .panel-overlay { flex: none; }
.panel-section { display: flex; flex-direction: column; gap: 12px; }
.panel-section h3 {
    margin: 0;
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}
.panel-links { display: flex; flex-direction: column; gap: 8px; }
.panel-links a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    text-decoration: none;
    color: var(--text);
    background: transparent;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-size: 14px;
    transition: background 140ms ease, border 140ms ease;
}
.panel-links a:hover { background: rgba(255, 255, 255, 0.05); border-color: var(--border); }
.panel-links a.is-active {
    background: rgba(78, 161, 255, 0.12);
    border-color: rgba(78, 161, 255, 0.35);
    color: var(--info);
}
.panel-links .badge-inline {
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(78, 161, 255, 0.12);
    border: 1px solid rgba(78, 161, 255, 0.35);
    font-size: 11px;
    color: var(--info);
    font-weight: 600;
}
.panel-toggle { font-size: 13px; font-weight: 600; }
.panel-toggle-open {
    display: none;
    position: fixed;
    top: 88px;
    left: 16px;
    z-index: 11;
}

.content-area {
    flex: 1 1 auto;
    padding: 36px 40px 160px;
    margin-left: 280px;
    width: calc(100% - 280px);
    display: flex;
    flex-direction: column;
    gap: 32px;
}
.content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.content-header h1 { font-size: clamp(26px, 3.6vw, 38px); }
.content-header .actions { display: flex; flex-wrap: wrap; gap: 12px; }

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}
.metric-card {
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--card);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.metric-card small { font-size: 11px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); }
.metric-card h3 { font-size: 26px; margin: 0; }
.metric-trend { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.metric-trend span { font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }

.callout-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}
.callout {
    padding: 18px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--card);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.callout h3 { font-size: 18px; }
.callout-success { border-color: rgba(46, 204, 113, 0.35); background: rgba(46, 204, 113, 0.12); }
.callout-warning { border-color: rgba(241, 196, 15, 0.35); background: rgba(241, 196, 15, 0.12); }
.callout-danger { border-color: rgba(231, 76, 60, 0.35); background: rgba(231, 76, 60, 0.12); }
.callout-success h3 { color: var(--success); }
.callout-warning h3 { color: var(--warning); }
.callout-danger h3 { color: var(--danger); }

.surface-module {
    padding: 26px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--card);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.surface-module header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.surface-module header h2 { font-size: 20px; }
.surface-module header small { color: var(--muted); }
.surface-module .module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}
.surface-module .module-grid .card-structured { box-shadow: var(--shadow-sm); }

.sparkline {
    position: relative;
    height: 56px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, rgba(78, 161, 255, 0.45), rgba(107, 91, 255, 0.25));
    border: 1px solid rgba(78, 161, 255, 0.45);
    overflow: hidden;
}
.sparkline::after {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0, rgba(255, 255, 255, 0.04) 1px, transparent 1px, transparent 20px);
    opacity: 0.4;
}

.module-table { width: 100%; border-collapse: collapse; }
.module-table th, .module-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.module-table thead th {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 11px;
    color: var(--muted);
}
.module-table tbody tr:hover { background: rgba(255, 255, 255, 0.03); }

.activity-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
}
.activity-list li {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    font-size: 13px;
}
.activity-list li span { color: var(--muted); font-size: 12px; }

.panel-overlay { display: none; flex: none; }

body.panel-collapsed .nav-panel {
    transform: translateX(-100%);
    box-shadow: none;
    pointer-events: none;
}
body.panel-collapsed .nav-panel .panel-header,
body.panel-collapsed .nav-panel .panel-scroll {
    opacity: 0;
    pointer-events: none;
}
body.panel-collapsed .panel-toggle-open { display: inline-flex; }
body.panel-collapsed .content-area {
    margin-left: 0;
    width: 100%;
}

@media (min-width: 901px) {
    .panel-toggle-open { left: 20px; }
}

@media (max-width: 1200px) {
    .content-area { padding: 32px 28px 150px; }
}

@media (max-width: 900px) {
    .theme-hero { padding-top: 16px; }
    .hero-card { order: -1; }
    .panel-layout { position: relative; }
    .nav-panel {
        width: 260px;
        box-shadow: var(--shadow-lg);
    }
    .panel-toggle-open { width: fit-content; left: 16px; top: 84px; }
    .panel-overlay {
        display: block;
        position: fixed;
        inset: 72px 0 0;
        background: rgba(4, 8, 18, 0.65);
        opacity: 0;
        pointer-events: none;
        transition: opacity 200ms ease;
        z-index: 2;
    }
    body:not(.panel-collapsed) .panel-overlay {
        opacity: 1;
        pointer-events: auto;
    }
    .content-area {
        padding: 28px 20px 140px;
        margin-left: 0;
        width: 100%;
    }
}

@media (max-width: 640px) {
    .content-header {
        align-items: flex-start;
    }
    .hero-highlights {
        grid-template-columns: 1fr;
    }
    .hero-actions { width: 100%; }
    .hero-actions .btn { flex: 1 1 auto; justify-content: center; }
    .component-grid, .pattern-grid, .metrics-grid { grid-template-columns: 1fr; }
    .surface-module header { align-items: flex-start; }
}
