@font-face {
    font-family: "Zed Mono";
    src: url("../fonts/zed-mono-extended.ttf") format("truetype");
    font-display: swap;
}
@font-face {
    font-family: "Zed Sans";
    src: url("../fonts/zed-sans-extended.ttf") format("truetype");
    font-display: swap;
}

:root {
    --md-code-font: "Zed Mono", system-ui, -apple-system, BlinkMacSystemFont,
                 'Segoe UI', sans-serif;
    --md-text-font: "Zed Sans", system-ui, -apple-system, BlinkMacSystemFont,
                 'Segoe UI', sans-serif;
}

.md-typeset,
.md-typeset p,
.md-typeset li,
.md-typeset dd,
.md-typeset td {
    font-family: 'Zed Sans', system-ui, -apple-system, BlinkMacSystemFont,
                 'Segoe UI', sans-serif;
    line-height: 1.6 !important;
    font-weight: 500;
}

/* Description elements: closer to headers, serif styling */
.md-typeset description {
    font-family: 'Zed Sans', serif !important;
    font-size: 0.95em !important;
}

.md-typeset h1,
.md-typeset h2,
.md-typeset h3,
.md-typeset h4,
.md-typeset h5,
.md-typeset h6 {
    font-family: 'Zed Sans', serif !important;
    font-weight: 600 !important;
    letter-spacing: -0.015em;
    margin-bottom: 0.35em !important;
}


.c1 {
    font-style: italic !important;
    font-weight: 300 !important;
}


.md-content__inner:has(.page-index) > h1 {
    display: none;
}

.md-content__inner .page-index {
    display: none;
}

/* Index hero image per theme */
.md-content__inner:has(.page-index) .hero-light,
.md-content__inner:has(.page-index) .hero-dark {
    display: none;
}

[data-md-color-scheme="default"] .md-content__inner:has(.page-index) .hero-light {
    display: block;
}

[data-md-color-scheme="slate"] .md-content__inner:has(.page-index) .hero-dark {
    display: block;
}

/* Index tagline alignment */
.md-content__inner:has(.page-index) .hero-tagline {
    text-align: center;
    margin-top: 0.75rem;
}

/* ---------- LIGHT: default ---------- */

[data-md-color-scheme="default"] {
    /* surfaces */
    --md-default-bg-color:        #f7f2e8;
    --md-default-fg-color:        #1f252b;
    --md-default-fg-color--light: #4a5058;
    --md-default-fg-color--lighter:#727984;

    /* cards / code / subtle panels */
    --md-surface-bg-color:        #fdfaf4;
    --md-surface-border-color:    rgba(15, 23, 42, 0.06);

    /* primary/accent (soft teal, desaturated) */
    --md-primary-fg-color:        #2b7f88;
    --md-primary-fg-color--light: #4d96a0;
    --md-primary-fg-color--dark:  #1f646e;

    --md-accent-fg-color:         #8a6f5b;
    --md-accent-fg-color--transparent: rgba(138, 111, 91, 0.16);

    /* links */
    --md-typeset-a-color:         var(--md-primary-fg-color);

    /* code & inline code */
    --md-code-bg-color:           #f3eee4;
    --md-code-fg-color:           #1f252b;

    /* borders / dividers */
    --md-divider-color:           rgba(43, 38, 30, 0.12);
}

/* Page background + cards */
[data-md-color-scheme="default"] body {
    background-color: var(--md-default-bg-color);
}

[data-md-color-scheme="default"] header {
    background-color: var(--md-default-bg-color) !important;
    box-shadow: 0px !important;
}

[data-md-color-scheme="default"] .md-content,
[data-md-color-scheme="default"] .md-main__inner,
[data-md-color-scheme="default"] .md-nav,
[data-md-color-scheme="default"] .md-sidebar {
    background-color: var(--md-default-bg-color);
}


[data-md-color-scheme="default"] .md-typeset {
    color: var(--md-default-fg-color);
}

/* Only style inline code background, let syntax highlighting handle code blocks */
[data-md-color-scheme="default"] .md-typeset code {
    background-color: var(--md-code-bg-color);
}

/* Code blocks: subtle shadow in light mode for separation */
[data-md-color-scheme="default"] .md-typeset pre {
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
    border: 1px solid var(--md-surface-border-color);
}

/* Ensure inline code (not in highlighted blocks) has readable color */
[data-md-color-scheme="default"] .md-typeset p code,
[data-md-color-scheme="default"] .md-typeset li code,
[data-md-color-scheme="default"] .md-typeset td code,
[data-md-color-scheme="default"] .md-typeset .admonition code,
[data-md-color-scheme="default"] .md-typeset a code {
    color: var(--md-code-fg-color);
}

/* Links: underlined but soft */
[data-md-color-scheme="default"] .md-typeset a {
    color: var(--md-primary-fg-color);
    text-decoration: none;
    border-bottom: 1px solid rgba(43, 127, 136, 0.35);
    transition: color 150ms ease, border-color 150ms ease;
}

[data-md-color-scheme="default"] .md-typeset a:hover,
[data-md-color-scheme="default"] .md-typeset a:focus {
    color: var(--md-primary-fg-color--light);
    border-bottom-color: rgba(43, 127, 136, 0.65);
}

/* Admonitions: outlined, soft fill */
[data-md-color-scheme="default"] .md-typeset .admonition,
[data-md-color-scheme="default"] .md-typeset details {
    border-radius: 0.6rem;
    border-width: 1px;
    border-style: solid;
    box-shadow: none;
}

/* generic base */
[data-md-color-scheme="default"] .md-typeset .admonition,
[data-md-color-scheme="default"] .md-typeset details {
    border-color: rgba(15, 23, 42, 0.10);
    background-color: #faf9f7;
}

/* type-specific tweaks */
[data-md-color-scheme="default"] .md-typeset .admonition.tip,
[data-md-color-scheme="default"] .md-typeset details.tip {
    border-color: rgba(43, 127, 136, 0.50);
    background-color: rgba(43, 127, 136, 0.04);
}

[data-md-color-scheme="default"] .md-typeset .admonition.note,
[data-md-color-scheme="default"] .md-typeset details.note {
    border-color: rgba(99, 102, 241, 0.45);
    background-color: rgba(99, 102, 241, 0.04);
}

[data-md-color-scheme="default"] .md-typeset .admonition.warning,
[data-md-color-scheme="default"] .md-typeset details.warning {
    border-color: rgba(217, 119, 6, 0.55);
    background-color: rgba(217, 119, 6, 0.06);
}

[data-md-color-scheme="default"] .md-typeset .admonition.danger,
[data-md-color-scheme="default"] .md-typeset details.danger {
    border-color: rgba(220, 38, 38, 0.55);
    background-color: rgba(220, 38, 38, 0.05);
}

/* ---------- DARK: slate ---------- */

[data-md-color-scheme="slate"] {
    /* surfaces */
    --md-default-bg-color:        #111318;
    --md-default-fg-color:        #e6e7ea;
    --md-default-fg-color--light: #c3c6cf;
    --md-default-fg-color--lighter:#9ba0ac;

    --md-surface-bg-color:        #161921;
    --md-surface-border-color:    rgba(148, 163, 184, 0.18);

    /* primary/accent – same family, slightly brighter */
    --md-primary-fg-color:        #4aa3ad;
    --md-primary-fg-color--light: #6bb8c1;
    --md-primary-fg-color--dark:  #2a7c85;

    --md-accent-fg-color:         #a08672;
    --md-accent-fg-color--transparent: rgba(160, 134, 114, 0.22);

    /* links */
    --md-typeset-a-color:         var(--md-primary-fg-color);

    /* code */
    --md-code-bg-color:           #111827;
    --md-code-fg-color:           #e5e7eb;

    /* dividers */
    --md-divider-color:           rgba(148, 163, 184, 0.28);
}

[data-md-color-scheme="slate"] body {
    background-color: var(--md-default-bg-color);
}

[data-md-color-scheme="slate"] .md-content,
[data-md-color-scheme="slate"] .md-main__inner,
[data-md-color-scheme="slate"] .md-nav,
[data-md-color-scheme="slate"] .md-sidebar {
    background-color: var(--md-default-bg-color);
}

/* Header for dark mode */
[data-md-color-scheme="slate"] .md-header {
    background-color: #0d0f13;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

[data-md-color-scheme="slate"] .md-typeset {
    color: var(--md-default-fg-color);
}

/* Only style inline code background, let syntax highlighting handle code blocks */
[data-md-color-scheme="slate"] .md-typeset code {
    background-color: var(--md-code-bg-color);
}

/* Ensure inline code (not in highlighted blocks) has readable color */
[data-md-color-scheme="slate"] .md-typeset p code,
[data-md-color-scheme="slate"] .md-typeset li code,
[data-md-color-scheme="slate"] .md-typeset td code,
[data-md-color-scheme="slate"] .md-typeset .admonition code,
[data-md-color-scheme="slate"] .md-typeset a code {
    color: var(--md-code-fg-color);
}

/* Links */
[data-md-color-scheme="slate"] .md-typeset a {
    color: var(--md-primary-fg-color);
    text-decoration: none;
    border-bottom: 1px solid rgba(74, 163, 173, 0.45);
    transition: color 150ms ease, border-color 150ms ease;
}

[data-md-color-scheme="slate"] .md-typeset a:hover,
[data-md-color-scheme="slate"] .md-typeset a:focus {
    color: var(--md-primary-fg-color--light);
    border-bottom-color: rgba(74, 163, 173, 0.75);
}

/* Admonitions: outlined, slightly brighter than background */
[data-md-color-scheme="slate"] .md-typeset .admonition,
[data-md-color-scheme="slate"] .md-typeset details {
    border-radius: 0.6rem;
    border-width: 1px;
    border-style: solid;
    box-shadow: none;
    border-color: rgba(148, 163, 184, 0.40);
    background-color: #151926;
}

/* type-specific */
[data-md-color-scheme="slate"] .md-typeset .admonition.tip,
[data-md-color-scheme="slate"] .md-typeset details.tip {
    border-color: rgba(74, 163, 173, 0.75);
    background-color: rgba(74, 163, 173, 0.08);
}

[data-md-color-scheme="slate"] .md-typeset .admonition.note,
[data-md-color-scheme="slate"] .md-typeset details.note {
    border-color: rgba(129, 140, 248, 0.75);
    background-color: rgba(129, 140, 248, 0.08);
}

[data-md-color-scheme="slate"] .md-typeset .admonition.warning,
[data-md-color-scheme="slate"] .md-typeset details.warning {
    border-color: rgba(245, 158, 11, 0.85);
    background-color: rgba(245, 158, 11, 0.10);
}

[data-md-color-scheme="slate"] .md-typeset .admonition.danger,
[data-md-color-scheme="slate"] .md-typeset details.danger {
    border-color: rgba(239, 68, 68, 0.85);
    background-color: rgba(239, 68, 68, 0.10);
}
