/* Mova — Public Theme
   Content that moves.
   Native light / dark mode via data-theme + system preference.
*/

/* ---------- Light (default) ---------- */
:root,
[data-theme="light"] {
    --color-bg: #f8f9fb;
    --color-surface: #ffffff;
    --color-text: #111827;
    --color-muted: #6b7280;
    --color-accent: #2563eb;
    --color-accent-hover: #1d4ed8;
    --color-border: #e5e7eb;
    --color-code-bg: #f3f4f6;
    --color-quote-border: #2563eb;
    --color-header-bg: rgba(255, 255, 255, 0.85);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    --max-width: 720px;
    --radius: 10px;
    color-scheme: light;
}

/* ---------- Dark ---------- */
[data-theme="dark"] {
    --color-bg: #0b0d12;
    --color-surface: #12151c;
    --color-text: #f3f4f6;
    --color-muted: #9ca3af;
    --color-accent: #60a5fa;
    --color-accent-hover: #93c5fd;
    --color-border: #1f2430;
    --color-code-bg: #1a1e28;
    --color-quote-border: #60a5fa;
    --color-header-bg: rgba(11, 13, 18, 0.88);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    color-scheme: dark;
}

/* System preference when no explicit choice is stored */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --color-bg: #0b0d12;
        --color-surface: #12151c;
        --color-text: #f3f4f6;
        --color-muted: #9ca3af;
        --color-accent: #60a5fa;
        --color-accent-hover: #93c5fd;
        --color-border: #1f2430;
        --color-code-bg: #1a1e28;
        --color-quote-border: #60a5fa;
        --color-header-bg: rgba(11, 13, 18, 0.88);
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
        color-scheme: dark;
    }
}

*, *::before, *::after { box-sizing: border-box; }

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    /* Explicit longhands so generic element rules (e.g. .site-main div)
       cannot zero only padding-left and glue content to the edge */
    padding-top: 0;
    padding-bottom: 0;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

/* Protect page gutters from bare element-style overrides */
.site-main > .container {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

/* ---------- Header ---------- */
.site-header {
    border-bottom: 1px solid var(--color-border);
    background: var(--color-header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0.875rem 0;
    position: sticky;
    top: 0;
    z-index: 50;
}

.site-header .container {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    box-sizing: border-box;
}

.logo {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--color-text);
    text-decoration: none;
    letter-spacing: -0.03em;
}

.logo span {
    color: var(--color-accent);
}

.header-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.35rem;
    margin-left: auto;
    flex-shrink: 0;
}

.nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav a {
    color: var(--color-muted);
    text-decoration: none;
    padding: 0.4rem 0.75rem;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
}

.nav a:hover {
    color: var(--color-accent);
}

/* Theme toggle */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-muted);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    padding: 0;
    flex-shrink: 0;
}

.theme-toggle:hover {
    color: var(--color-text);
    border-color: var(--color-muted);
}

.theme-toggle svg {
    width: 1.125rem;
    height: 1.125rem;
    display: block;
}

.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }

[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
    :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

[data-theme="light"] .theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* ---------- Main ---------- */
.site-main {
    padding: 2.5rem 0 4rem;
    min-height: 60vh;
}

.hero {
    text-align: center;
    padding: 2rem 0 2.5rem;
}

.hero h1 {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    margin: 0 0 0.75rem;
    line-height: 1.15;
}

.lead {
    font-size: 1.1rem;
    color: var(--color-muted);
    margin: 0 auto;
    max-width: 36rem;
}

.content-list h2 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 1.25rem;
    color: var(--color-muted);
    font-weight: 600;
}

.content-card {
    padding: 1.35rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
}

.content-card:last-child { border-bottom: none; }

.content-card h3 {
    margin: 0 0 0.4rem;
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.content-card h3 a {
    color: var(--color-text);
    text-decoration: none;
}

.content-card h3 a:hover { color: var(--color-accent); }

.content-card p {
    margin: 0 0 0.45rem;
    color: var(--color-muted);
    font-size: 0.95rem;
}

.content-card time,
.content-meta {
    font-size: 0.8rem;
    color: var(--color-muted);
}

.content-meta {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.article-header {
    margin-bottom: 2rem;
}

.article-header h1 {
    font-size: clamp(1.75rem, 4.5vw, 2.35rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin: 0 0 0.75rem;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    font-size: 0.875rem;
    color: var(--color-muted);
}

.article-body {
    font-size: 1.05rem;
}

.article-body h2 {
    font-size: 1.4rem;
    margin: 2rem 0 0.75rem;
    letter-spacing: -0.02em;
}

.article-body h3 {
    font-size: 1.2rem;
    margin: 1.75rem 0 0.6rem;
}

.article-body p {
    margin: 0 0 1.15rem;
}

.article-body ul,
.article-body ol {
    margin: 0 0 1.15rem;
    padding-left: 1.4rem;
}

.article-body li { margin-bottom: 0.35rem; }

.article-body blockquote {
    margin: 1.5rem 0;
    padding: 0.75rem 0 0.75rem 1.25rem;
    border-left: 3px solid var(--color-quote-border);
    color: var(--color-muted);
    font-style: italic;
}

.article-body pre,
.article-body code {
    font-family: var(--font-mono);
    font-size: 0.875em;
}

.article-body pre {
    background: var(--color-code-bg, #f3f4f6);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    border-left: none;
    padding: 1rem 1.15rem;
    overflow-x: auto;
    margin: 1.25rem 0;
    color: var(--color-text, inherit);
}

.article-body pre code {
    background: transparent;
    padding: 0;
    color: inherit;
    font-size: inherit;
}

.article-body :not(pre) > code {
    background: var(--color-code-bg);
    padding: 0.15em 0.4em;
    border-radius: 4px;
    font-size: 0.9em;
}

.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    margin: 1.25rem 0;
}

.article-body hr {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 2rem 0;
}

.article-body a {
    color: var(--color-accent);
    text-decoration: none;
}

.article-body a:hover {
    color: var(--color-accent-hover);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.article-body figure {
    margin: 1.5rem 0;
}
.article-body figure img {
    margin: 0;
    display: block;
}
.article-body figcaption {
    font-size: 0.85rem;
    color: var(--color-muted);
    margin-top: 0.5rem;
}
.article-body .gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
    margin: 1.5rem 0;
}
.article-body .gallery figure { margin: 0; }
.article-body .gallery img { margin: 0; width: 100%; height: auto; }
.article-body .video-embed,
.article-body .embed {
    margin: 1.75rem 0;
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
}
.article-body .video-embed iframe,
.article-body .video-embed video,
.article-body .embed iframe {
    width: 100%;
    height: 100%;
    border: 0;
}
.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.95rem;
}
.article-body th,
.article-body td {
    border: 1px solid var(--color-border);
    padding: 0.6rem 0.85rem;
    text-align: left;
}
.article-body th {
    background: var(--color-code-bg);
    font-weight: 600;
}
.article-body aside.callout {
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    background: color-mix(in srgb, var(--color-accent) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--color-accent) 30%, transparent);
    border-radius: var(--radius);
}
.article-body aside.callout p { margin: 0; }
.article-body a.btn {
    display: inline-block;
    padding: 0.6rem 1.25rem;
    background: var(--color-accent);
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 6px;
    font-weight: 500;
}
.article-body a.btn:hover {
    background: var(--color-accent-hover);
}
.article-body .faq-item {
    margin: 1.25rem 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
}
.article-body .faq-question {
    margin: 0;
    padding: 0.85rem 1.1rem;
    font-size: 1.05rem;
    background: var(--color-code-bg);
}
.article-body .faq-answer {
    padding: 0.85rem 1.1rem;
}
.article-body .faq-answer p:last-child { margin-bottom: 0; }

.search-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.search-form input[type="search"] {
    flex: 1;
    padding: 0.7rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
    color: var(--color-text);
    font: inherit;
    font-size: 1rem;
}

.search-form input[type="search"]:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

[data-theme="dark"] .search-form input[type="search"]:focus {
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}

.search-form button {
    padding: 0.7rem 1.25rem;
    border: none;
    border-radius: var(--radius);
    background: var(--color-accent);
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.search-form button:hover {
    background: var(--color-accent-hover);
}

.search-results-count {
    color: var(--color-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.error-page {
    text-align: center;
    padding: 4rem 0;
}

.error-page .error-code {
    font-size: 4rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    color: var(--color-muted);
    margin: 0 0 0.5rem;
    opacity: 0.5;
}

.error-page h1 {
    font-size: 1.5rem;
    margin: 0 0 0.75rem;
}

.error-page p {
    color: var(--color-muted);
    margin: 0 0 1.5rem;
}

.error-page a {
    color: var(--color-accent);
    font-weight: 500;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--color-muted);
}

.empty-state a {
    color: var(--color-accent);
}

.site-footer {
    border-top: 1px solid var(--color-border);
    padding: 1.75rem 0;
    margin-top: auto;
}

.site-footer .container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--color-muted);
}

.site-footer a {
    color: var(--color-muted);
    text-decoration: none;
}

.site-footer a:hover {
    color: var(--color-accent);
}

.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;
}

/* ---------- Mobile menu toggle (hidden on desktop) ---------- */
.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.nav-toggle:hover {
    border-color: var(--color-muted);
    color: var(--color-text);
}

.nav-toggle i {
    font-size: 1.05rem;
    line-height: 1;
    display: inline-block;
    color: inherit;
}

.nav-toggle-svg {
    width: 1.25rem;
    height: 1.25rem;
    display: block;
    flex-shrink: 0;
    color: inherit;
    stroke: currentColor;
}

.nav-toggle-img {
    width: 1.25rem;
    height: 1.25rem;
    object-fit: contain;
    display: block;
}

/* Mobile nav — styles: drawer-top | drawer-right | drawer-left | fullscreen | bottom-sheet */
.nav-drawer {
    background: var(--color-surface);
    z-index: 120;
    overflow: auto;
    pointer-events: auto;
    -webkit-overflow-scrolling: touch;
}
.nav-drawer-links {
    display: flex;
    flex-direction: column;
    padding: 0.75rem 1.25rem 1.25rem;
    gap: 0.15rem;
}
.nav-drawer-links a {
    color: var(--color-text);
    text-decoration: none;
    padding: 0.75rem 0.85rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.95rem;
}
.nav-drawer-links a:hover {
    background: var(--color-bg);
    color: var(--color-accent);
}
/* Drawer actions (Search / Theme) match link rows — full width, not icon-only */
.nav-drawer .nav-drawer-action,
.nav-drawer .nav-drawer-action.theme-toggle,
.nav-drawer button.theme-toggle.nav-drawer-action {
    display: flex !important;
    align-items: center;
    gap: 0.65rem;
    width: 100% !important;
    max-width: 100%;
    height: auto !important;
    min-height: 2.5rem;
    box-sizing: border-box;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--color-text);
    font: inherit;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.75rem 0.85rem !important;
    cursor: pointer;
    text-decoration: none;
    flex-shrink: 0;
    margin: 0;
}
.nav-drawer .nav-drawer-action svg,
.nav-drawer .nav-drawer-action.theme-toggle svg {
    width: 1.125rem;
    height: 1.125rem;
    flex-shrink: 0;
}

/* Content alignment inside mobile menu (links + Search + Theme) */
body.mobile-nav-align-left .nav-drawer-links {
    text-align: left;
    align-items: stretch;
}
body.mobile-nav-align-left .nav-drawer-links a,
body.mobile-nav-align-left .nav-drawer .nav-drawer-action,
body.mobile-nav-align-left .nav-drawer .theme-toggle {
    justify-content: flex-start !important;
    text-align: left;
    margin-left: 0;
    margin-right: 0;
    align-self: stretch;
    width: 100% !important;
}

body.mobile-nav-align-center .nav-drawer-links {
    text-align: center;
    align-items: stretch;
}
body.mobile-nav-align-center .nav-drawer-links a,
body.mobile-nav-align-center .nav-drawer .nav-drawer-action,
body.mobile-nav-align-center .nav-drawer .theme-toggle {
    justify-content: center !important;
    text-align: center;
    width: 100% !important;
    align-self: stretch;
}

body.mobile-nav-align-right .nav-drawer-links {
    text-align: right;
    align-items: stretch;
}
body.mobile-nav-align-right .nav-drawer-links a,
body.mobile-nav-align-right .nav-drawer .nav-drawer-action,
body.mobile-nav-align-right .nav-drawer .theme-toggle {
    justify-content: flex-end !important;
    text-align: right;
    width: 100% !important;
    align-self: stretch;
    flex-direction: row;
}
.nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 100;
    opacity: 0;
    transition: opacity 0.22s ease;
    pointer-events: none;
}
.nav-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}
body.nav-open { overflow: hidden; }
/* Elevate sticky header stacking context above backdrop so the in-header drawer is clickable */
body.nav-open .site-header {
    z-index: 110;
}

/* Top dropdown — from top of screen, 60vh × 60vw centered */
body.mobile-nav-drawer-top .nav-drawer,
body.mobile-nav-drawer .nav-drawer {
    position: fixed;
    top: 0;
    left: 50%;
    right: auto;
    width: 60vw;
    max-width: 60vw;
    height: 60vh;
    max-height: 60vh;
    border-bottom: 1px solid var(--color-border);
    border-radius: 0 0 12px 12px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
    transform: translateX(-50%) translateY(-105%);
    opacity: 0;
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
    overflow-y: auto;
}
body.mobile-nav-drawer-top .nav-drawer.is-open,
body.mobile-nav-drawer .nav-drawer.is-open {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Right drawer — top of screen, 60vh × 60vw */
body.mobile-nav-drawer-right .nav-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: auto;
    height: 60vh;
    max-height: 60vh;
    width: 60vw;
    max-width: 60vw;
    border-left: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    border-radius: 0 0 0 12px;
    box-shadow: -12px 0 32px rgba(0, 0, 0, 0.14);
    transform: translateX(105%);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    overflow-y: auto;
    padding-top: 0.5rem;
}
body.mobile-nav-drawer-right .nav-drawer.is-open {
    transform: translateX(0);
}

/* Left drawer — top of screen, 60vh × 60vw */
body.mobile-nav-drawer-left .nav-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: auto;
    height: 60vh;
    max-height: 60vh;
    width: 60vw;
    max-width: 60vw;
    border-right: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    border-radius: 0 0 12px 0;
    box-shadow: 12px 0 32px rgba(0, 0, 0, 0.14);
    transform: translateX(-105%);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    overflow-y: auto;
    padding-top: 0.5rem;
}
body.mobile-nav-drawer-left .nav-drawer.is-open {
    transform: translateX(0);
}

/* Fullscreen */
body.mobile-nav-fullscreen .nav-drawer {
    position: fixed;
    inset: 0;
    width: 100%;
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem 1.5rem;
}
body.mobile-nav-fullscreen .nav-drawer.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
body.mobile-nav-fullscreen .nav-drawer-links a {
    font-size: 1.25rem;
    padding: 0.9rem 1rem;
    text-align: center;
}

/* Bottom sheet */
body.mobile-nav-bottom-sheet .nav-drawer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: min(70vh, 28rem);
    border-radius: 16px 16px 0 0;
    border-top: 1px solid var(--color-border);
    box-shadow: 0 -12px 32px rgba(0, 0, 0, 0.14);
    transform: translateY(105%);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    overflow-y: auto;
    padding-bottom: env(safe-area-inset-bottom, 0.5rem);
}
body.mobile-nav-bottom-sheet .nav-drawer.is-open {
    transform: translateY(0);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
}

/* ---------- Tablet (768px) ---------- */
@media (max-width: 768px) {
    .nav {
        display: none !important;
    }

    .nav-toggle {
        display: inline-flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        color: var(--color-text) !important;
    }
    .nav-toggle i,
    .nav-toggle .nav-toggle-svg,
    .nav-toggle .nav-toggle-img {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        color: inherit !important;
    }

    .container,
    .site-main > .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .site-main {
        padding: 1.75rem 0 3rem;
    }

    .hero {
        padding: 1.25rem 0 1.75rem;
    }

    .hero h1 {
        font-size: clamp(1.5rem, 6vw, 2rem);
    }
}

/* ---------- Phone (480px) ---------- */
@media (max-width: 480px) {
    .site-header .container {
        gap: 0.5rem;
    }

    .logo {
        font-size: 1.05rem;
    }

    .logo img {
        height: 24px !important;
    }

    .header-actions {
        gap: 0.45rem;
    }

    .theme-toggle,
    .nav-toggle {
        width: 2.1rem;
        height: 2.1rem;
    }

    .site-footer .container {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .container,
    .site-main > .container {
        padding-left: 0.875rem;
        padding-right: 0.875rem;
    }
}

/* ---------- Wide tablet / small laptop refinements ---------- */
@media (min-width: 769px) and (max-width: 1024px) {
    .container,
    .site-main > .container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    :root {
        --max-width: 680px;
    }
}

/* ---------- Layout modifiers (from Design → Layout) ---------- */
body.header-static .site-header {
    position: relative;
}
body.header-floating .site-header {
    margin: 0.75rem auto;
    max-width: calc(var(--max-width) + 2.5rem);
    border-radius: var(--radius-md, 10px);
    border: 1px solid var(--color-border);
}
body.header-transparent .site-header {
    background: transparent;
    border-bottom-color: transparent;
    backdrop-filter: none;
}

body.logo-center .site-header .container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
}
body.logo-center .site-header .logo {
    justify-self: center;
    grid-column: 2;
}
body.logo-center .header-actions {
    justify-self: end;
    grid-column: 3;
}

body.nav-left .header-actions {
    flex-direction: row-reverse;
}
body.nav-center .site-header .container {
    flex-wrap: wrap;
    justify-content: center;
}
body.nav-center .header-actions {
    width: 100%;
    justify-content: center;
}

body.footer-centered .site-footer .container {
    flex-direction: column;
    text-align: center;
    justify-content: center;
}

/* ---------- Component variants ---------- */
.mova-btn,
a.btn,
button.btn,
.btn-primary {
    border-radius: var(--radius-button, var(--radius, 10px));
    font-weight: 600;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

body.btn-uppercase .mova-btn,
body.btn-uppercase a.btn,
body.btn-uppercase button.btn {
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.85em;
}

body.btn-solid .mova-btn,
body.btn-solid .btn-primary {
    background: var(--color-accent);
    color: #fff;
    border: 1px solid transparent;
}
body.btn-outline .mova-btn,
body.btn-outline .btn-primary {
    background: transparent;
    color: var(--color-accent);
    border: 2px solid var(--color-accent);
}
body.btn-ghost .mova-btn,
body.btn-ghost .btn-primary {
    background: transparent;
    color: var(--color-accent);
    border: 1px solid transparent;
}
body.btn-soft .mova-btn,
body.btn-soft .btn-primary {
    background: color-mix(in srgb, var(--color-accent) 15%, transparent);
    color: var(--color-accent);
    border: 1px solid transparent;
}

.mova-card,
.content-card,
.card {
    border-radius: var(--radius-card, var(--radius, 10px));
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

body.card-flat .mova-card,
body.card-flat .content-card,
body.card-flat .card {
    background: var(--color-surface);
    border: none;
    box-shadow: none;
}
body.card-elevated .mova-card,
body.card-elevated .content-card,
body.card-elevated .card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}
body.card-outlined .mova-card,
body.card-outlined .content-card,
body.card-outlined .card {
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    box-shadow: none;
}
body.card-glass .mova-card,
body.card-glass .content-card,
body.card-glass .card {
    background: color-mix(in srgb, var(--color-surface) 70%, transparent);
    border: 1px solid var(--color-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

body.card-hover-lift .mova-card:hover,
body.card-hover-lift .content-card:hover,
body.card-hover-lift .card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}
body.card-hover-scale .mova-card:hover,
body.card-hover-scale .content-card:hover,
body.card-hover-scale .card:hover {
    transform: scale(1.02);
}
body.card-hover-border .mova-card:hover,
body.card-hover-border .content-card:hover,
body.card-hover-border .card:hover {
    border-color: var(--color-accent);
}

/* Hero variants */
.hero {
    padding: var(--space-section, 2.5rem) 0;
}
body.hero-centered .hero {
    text-align: center;
}
body.hero-split .hero {
    text-align: left;
    display: grid;
    gap: 1.5rem;
}
@media (min-width: 769px) {
    body.hero-split .hero {
        grid-template-columns: 1fr 1fr;
        align-items: center;
    }
}
body.hero-minimal .hero {
    padding: 1rem 0 1.5rem;
    text-align: left;
}
body.hero-minimal .hero h1 {
    font-size: clamp(1.35rem, 4vw, 1.85rem);
}
body.hero-fullscreen .hero {
    min-height: min(70vh, 560px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}

/* Density */
.site-main {
    padding-top: var(--space-section, 2.5rem);
    padding-bottom: calc(var(--space-section, 2.5rem) * 1.4);
}

/* ---------- Icon + text controls (theme, menu) ---------- */
.icon-label {
    gap: 0.4rem;
    width: auto !important;
    padding: 0 0.65rem !important;
    min-width: 2.25rem;
}

.icon-label-text {
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1;
}

@media (max-width: 480px) {
    /* Phone: icon only, text on hover/focus */
    .icon-label-text {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        border: 0;
    }
    .icon-label {
        position: relative;
        width: 2.25rem !important;
        padding: 0 !important;
    }
    .icon-label:hover .icon-label-text,
    .icon-label:focus-visible .icon-label-text {
        position: absolute;
        width: auto;
        height: auto;
        margin: 0;
        clip: auto;
        overflow: visible;
        top: calc(100% + 0.35rem);
        left: 50%;
        transform: translateX(-50%);
        background: var(--color-surface);
        border: 1px solid var(--color-border);
        border-radius: 6px;
        padding: 0.3rem 0.5rem;
        white-space: nowrap;
        z-index: 70;
        box-shadow: var(--shadow-sm);
        color: var(--color-text);
    }
}



/* Hide text labels on desktop icon controls */
.header-actions .icon-label-text {
    display: none;
}
.nav-drawer-action {
    display: flex !important;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    color: var(--color-text);
    font: inherit;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.75rem 0.85rem;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
}
.nav-drawer-action:hover {
    background: var(--color-bg);
    color: var(--color-accent);
}
.nav-drawer-action svg {
    flex-shrink: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: nowrap;
}
.site-header .container {
    flex-wrap: nowrap;
}
.logo {
    white-space: nowrap;
    min-width: 0;
}

/* Icon-only header controls (desktop) */
.header-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-muted);
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    text-decoration: none;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.header-icon-btn:hover {
    color: var(--color-text);
    border-color: var(--color-muted);
}
.header-icon-btn svg {
    width: 1.125rem;
    height: 1.125rem;
    display: block;
}
.header-icon-btn--circle {
    border-radius: 999px;
}
.header-actions .icon-label-text {
    display: none;
}
.nav-drawer-action {
    display: flex !important;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    color: var(--color-text);
    font: inherit;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.75rem 0.85rem;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    box-sizing: border-box;
}
.nav-drawer-action:hover {
    background: var(--color-bg);
    color: var(--color-accent);
}
.nav-drawer-action svg {
    flex-shrink: 0;
    width: 1.125rem;
    height: 1.125rem;
}
.nav-drawer-action .icon-sun { display: none; }
.nav-drawer-action .icon-moon { display: block; }
[data-theme="dark"] .nav-drawer-action .icon-sun { display: block; }
[data-theme="dark"] .nav-drawer-action .icon-moon { display: none; }
[data-theme="light"] .nav-drawer-action .icon-sun { display: none; }
[data-theme="light"] .nav-drawer-action .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .nav-drawer-action .icon-sun { display: block; }
    :root:not([data-theme="light"]) .nav-drawer-action .icon-moon { display: none; }
}
