/* Scope themes to <html> only. Do NOT use :root here — it always matches <html> and can
   prevent the light theme variables from winning in the cascade. */
html[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0b0f14;
    --bg-elevated: #121922;
    --surface: #161d27;
    --border: #243041;
    --text: #e8edf4;
    --muted: #8b98ab;
    --accent: #3dd6c6;
    --accent-dim: #2a9d8f;
    --danger: #f07178;
    --radius: 12px;
    --font: "DM Sans", system-ui, sans-serif;
    --mono: "JetBrains Mono", ui-monospace, monospace;
    --body-gradient: radial-gradient(1200px 600px at 10% -10%, #132032 0%, transparent 50%),
        radial-gradient(800px 400px at 90% 0%, #1a2838 0%, transparent 45%),
        var(--bg);
    --header-bg: rgba(11, 15, 20, 0.85);
    --section-alt-bg: rgba(18, 25, 34, 0.5);
    --card-hover-border: #3a4a5f;
    --btn-primary-fg: #0b0f14;
    --logo-tile-bg: #121922;
    --logo-tile-stroke: #243041;
    --logo-accent: #3dd6c6;
    --logo-accent-dim: #2a9d8f;
    --meta-theme: #0b0f14;
}

html[data-theme="light"] {
    color-scheme: light;
    --bg: #eef1f6;
    --bg-elevated: #ffffff;
    --surface: #ffffff;
    --border: #c8d0dc;
    --text: #0f1419;
    --muted: #4a5568;
    --accent: #0d9488;
    --accent-dim: #0f7668;
    --danger: #c53030;
    --body-gradient: linear-gradient(180deg, #ffffff 0%, #e8edf4 55%, #eef1f6 100%);
    --header-bg: rgba(255, 255, 255, 0.92);
    --section-alt-bg: rgba(255, 255, 255, 0.75);
    --card-hover-border: #94a3b8;
    --btn-primary-fg: #f8fafc;
    --logo-tile-bg: #ffffff;
    --logo-tile-stroke: #c8d0dc;
    --logo-accent: #0d9488;
    --logo-accent-dim: #0f7668;
    --meta-theme: #ffffff;
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--text);
    background: var(--body-gradient);
}

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

a:hover {
    text-decoration: underline;
}

.skip-link {
    position: absolute;
    left: -9999px;
}

.skip-link:focus {
    left: 1rem;
    top: 1rem;
    z-index: 100;
    padding: 0.5rem 1rem;
    background: var(--surface);
    border-radius: 6px;
}

.container {
    width: min(1100px, 92vw);
    margin: 0 auto;
}

.container.narrow {
    width: min(640px, 92vw);
}

.site-header {
    border-bottom: 1px solid var(--border);
    background: var(--header-bg);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0;
}

.header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem 1rem;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
}
.theme-toggle--floating {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 70;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 999px;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.25);
}

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

.theme-toggle__icon {
    display: none;
    line-height: 0;
}

html[data-theme="dark"] .theme-toggle__icon--sun,
html[data-theme="light"] .theme-toggle__icon--moon {
    display: block;
}

.logo {
    font-weight: 700;
    letter-spacing: -0.02em;
    font-size: 1.15rem;
    color: var(--text);
}

.logo:hover {
    text-decoration: none;
    color: var(--accent);
}

.nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.25rem;
    font-size: 0.95rem;
}

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

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

.hero {
    padding: 4rem 0 3rem;
}

.eyebrow {
    font-family: var(--mono);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent-dim);
    margin: 0 0 1rem;
}

.hero h1 {
    font-size: clamp(2rem, 4vw, 2.75rem);
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin: 0 0 1rem;
    max-width: 18ch;
}

.lead {
    font-size: 1.15rem;
    color: var(--muted);
    max-width: 55ch;
    margin: 0 0 1.5rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1.25rem;
    border-radius: 999px;
    border: 1px solid var(--accent);
    background: linear-gradient(180deg, var(--accent) 0%, var(--accent-dim) 100%);
    color: var(--btn-primary-fg);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: none;
}

.btn:hover {
    filter: brightness(1.05);
    text-decoration: none;
}

.btn--ghost {
    background: transparent;
    color: var(--text);
    border-color: var(--border);
}

.btn--ghost:hover {
    border-color: var(--muted);
}

.btn--sm {
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
}

.section {
    padding: 3rem 0;
}

.section--alt {
    background: var(--section-alt-bg);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.section h2 {
    margin: 0 0 0.5rem;
    font-size: 1.5rem;
}

.section-intro {
    color: var(--muted);
    margin: 0 0 2rem;
    max-width: 50ch;
}

.grid {
    display: grid;
    gap: 1.25rem;
}

@media (min-width: 720px) {
    .grid--2 {
        grid-template-columns: 1fr 1fr;
    }
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.card--lift:hover {
    border-color: var(--card-hover-border);
    transition: border-color 0.2s;
}

.card h2,
.card h3 {
    margin-top: 0;
    font-size: 1.15rem;
}

.card p:last-child {
    margin-bottom: 0;
    color: var(--muted);
}

.solution-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.solution-list li {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border);
}

.solution-list li:last-child {
    border-bottom: none;
}

.solution-list h3 {
    margin: 0 0 0.5rem;
    font-size: 1.2rem;
}

.solution-list p {
    margin: 0;
    color: var(--muted);
}

.mt-lg {
    margin-top: 2rem;
}

.link {
    font-weight: 600;
}

.page-head {
    padding: 3rem 0 1rem;
}

.page-head--compact {
    padding: 2.5rem 0 0;
}

.page-head h1 {
    margin: 0 0 0.75rem;
    font-size: clamp(1.75rem, 3vw, 2.25rem);
}

.prose-block {
    padding: 2rem 0;
    border-bottom: 1px solid var(--border);
}

.prose-block:last-child {
    border-bottom: none;
}

.prose-block h2 {
    margin-top: 0;
    font-size: 1.35rem;
}

.prose-block p {
    color: var(--muted);
    margin: 0;
}

.contact-card {
    margin-bottom: 2rem;
}

.contact-form label {
    display: block;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--muted);
}

.contact-form input,
.contact-form textarea {
    display: block;
    width: 100%;
    margin-top: 0.35rem;
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text);
    font: inherit;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: 2px solid var(--accent-dim);
    outline-offset: 1px;
}

.banner {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.banner--error {
    background: rgba(240, 113, 120, 0.12);
    border: 1px solid rgba(240, 113, 120, 0.35);
    color: #ffb4b8;
}

.dashboard-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.status-pill {
    display: inline-block;
    margin: 0;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-family: var(--mono);
    background: rgba(61, 214, 198, 0.12);
    color: var(--accent);
}

.muted {
    color: var(--muted);
}

.small {
    font-size: 0.85rem;
}

code {
    font-family: var(--mono);
    font-size: 0.9em;
    background: var(--bg-elevated);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
}

.site-footer {
    margin-top: 4rem;
    padding: 2rem 0;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1.5rem;
}

.footer-links {
    display: flex;
    gap: 1rem;
}

.footer-links a {
    color: var(--muted);
}

/* Brand lockup */
.logo--brand {
    display: inline-flex;
    align-items: center;
    gap: 0;
}

.logo-image {
    display: block;
    width: clamp(150px, 22vw, 230px);
    height: auto;
    max-height: 48px;
}

html[data-theme="dark"] .logo-image--light {
    display: none;
}

html[data-theme="light"] .logo-image--dark {
    display: none;
}

/* Articles */
.article-meta {
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--accent-dim);
    margin: 0 0 0.5rem;
}

.article-meta a {
    color: var(--accent-dim);
}

.article-grid {
    display: grid;
    gap: 1.25rem;
}

@media (min-width: 720px) {
    .article-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 1000px) {
    .article-grid--home {
        grid-template-columns: repeat(3, 1fr);
    }
}

.article-card h2,
.article-card h3 {
    margin-top: 0;
    font-size: 1.12rem;
    line-height: 1.35;
}

.article-card h2 a,
.article-card h3 a {
    color: var(--text);
}

.article-card h2 a:hover,
.article-card h3 a:hover {
    color: var(--accent);
    text-decoration: none;
}

.section--article {
    padding-top: 0;
}

.article-body {
    color: var(--muted);
    line-height: 1.75;
    font-size: 1.05rem;
}

.article-page .page-head h1 {
    font-size: clamp(1.45rem, 3vw, 2rem);
}

.media-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--border);
    margin: 0 0 1rem;
    display: block;
}

.solution-media {
    margin-bottom: 0.9rem;
}

.article-media {
    margin-bottom: 1rem;
}

@media (max-width: 900px) {
    .header-inner {
        align-items: flex-start;
        flex-direction: column;
    }
    .header-actions {
        width: 100%;
        justify-content: space-between;
    }
    .nav {
        gap: 0.55rem 0.9rem;
    }
}
