/*
 * Reified's own theme for the FsLiveDocs-generated site (DaisyUI/Tailwind markup —
 * .navbar / .drawer-content / .drawer-side / #search-ui / main / aside), not the old
 * Docsy layout this project used before the FsLiveDocs migration. Precise and a little
 * severe: a cool paper background, a monospace-inflected accent, sharp corners over
 * soft ones — "engineered", not "friendly".
 */

:root,
[data-theme="light"] {
    --reified-bg: #f4f3ef;
    --reified-surface: #ffffff;
    --reified-surface-soft: #eae8e1;
    --reified-text: #17181a;
    --reified-muted: #52565c;
    --reified-faint: #82868c;
    --reified-border: rgba(23, 24, 26, 0.12);
    --reified-accent: #1f5fae;
    --reified-accent-soft: rgba(31, 95, 174, 0.08);
}

[data-theme="dark"] {
    --reified-bg: #121316;
    --reified-surface: #1a1c20;
    --reified-surface-soft: #202226;
    --reified-text: #e7e8ea;
    --reified-muted: #a7abb2;
    --reified-faint: #75797f;
    --reified-border: rgba(231, 232, 234, 0.12);
    --reified-accent: #6ea8ff;
    --reified-accent-soft: rgba(110, 168, 255, 0.1);
}

:root {
    --reified-display-font: "IBM Plex Serif", Georgia, "Times New Roman", serif;
    --reified-sans-font: "Source Sans 3", "Segoe UI", Arial, sans-serif;
    --reified-mono-font: "Fira Code", "IBM Plex Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
    --reified-radius: 4px;
}

html,
body,
.drawer-content {
    background: var(--reified-bg) !important;
    color: var(--reified-text);
    font-family: var(--reified-sans-font);
}

.navbar,
.drawer-side > div {
    background: var(--reified-bg) !important;
    border-color: var(--reified-border) !important;
}

/* Content typography ------------------------------------------------------------- */

main #content {
    max-width: 76ch;
}

main h1,
main h2,
main h3,
main h4 {
    font-family: var(--reified-display-font);
    font-weight: 700;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

main h1:first-child {
    font-size: clamp(2rem, 4vw, 2.8rem);
    line-height: 1.05;
}

main p,
main li,
main td {
    color: var(--reified-text);
    line-height: 1.7;
}

main a {
    color: var(--reified-accent);
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.16em;
}

main code,
main pre,
main kbd {
    font-family: var(--reified-mono-font);
    font-size: 0.92em;
}

main pre {
    border-radius: var(--reified-radius);
    border: 1px solid var(--reified-border);
    background: var(--reified-surface-soft);
}

main :not(pre) > code {
    padding: 0.1rem 0.35rem;
    border-radius: var(--reified-radius);
    background: var(--reified-accent-soft);
    color: var(--reified-text);
}

/* Semantic tooltips use a fixed dark surface in FsLiveDocs. Keep nested prose and
   inline code from inheriting the page theme's foreground and code background. */
.fsdocs-tip,
.fsdocs-tip p,
.fsdocs-tip li,
.fsdocs-tip code,
.fsdocs-tip strong {
    color: #f8fafc !important;
}

.fsdocs-tip code {
    background: transparent !important;
}

main table {
    display: table;
    width: auto !important;
    max-width: 100%;
    margin: 1.5rem auto;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--reified-border);
    border-radius: var(--reified-radius);
}

main th,
main td {
    padding: 0.7rem 1rem !important;
    vertical-align: top;
    text-align: left;
    white-space: normal;
    border-color: var(--reified-border);
}

main th {
    background: var(--reified-surface-soft);
    color: var(--reified-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
}

/* Landing page: full-bleed, no chrome ---------------------------------------------- */

.drawer-content:has(.reified-landing) > .grid {
    display: block;
    padding: 0;
}

body:has(.reified-landing) > .navbar {
    display: none;
}

body:has(.reified-landing) #search-ui {
    display: none;
}

.drawer-content:has(.reified-landing) main {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
    background: var(--reified-bg);
    box-shadow: none;
}

.drawer-content:has(.reified-landing) aside,
.drawer:has(.reified-landing) .drawer-side {
    display: none !important;
}

.docs-home-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 3rem 2rem 4rem;
}

.docs-home-hero {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 1.5rem;
    padding: 1rem 0 0;
    text-align: center;
}

.docs-home-hero-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
}

.hero-lockup {
    width: 100%;
    height: auto;
}

.docs-home-copy {
    max-width: 78ch;
    margin: 0 auto;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 1rem;
    padding: 0.3rem 0.75rem;
    border: 1px solid var(--reified-border);
    border-radius: 999px;
    background: var(--reified-surface);
    color: var(--reified-accent);
    font: 600 0.72rem/1 var(--reified-mono-font);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.docs-home-copy h1 {
    margin: 0 0 1.25rem;
    color: var(--reified-text);
    font-family: var(--reified-display-font);
    font-weight: 700;
    font-size: clamp(2.2rem, 4.6vw, 3.6rem);
    line-height: 1.05;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

.lede {
    max-width: 62ch;
    margin: 0 auto 0.5rem;
    color: var(--reified-muted);
    font-size: 1.15rem;
    line-height: 1.65;
}

/*
 * The rendered code block (.livedocs-code > pre.code-frame) already draws its own card:
 * background, border-radius, and negative margins that bleed it to the edge of whatever
 * prose container it sits in. Wrapping it in a second bordered/padded card here produced
 * a box-in-a-box with a mismatched gap between them. This wrapper is now just a width
 * constraint; the code frame supplies the only visible border and background.
 */
.docs-home-example {
    max-width: 60rem;
    margin: 0 auto 1.5rem;
    text-align: left;
}

.docs-home-example .livedocs-code {
    margin: 0 !important;
}

.docs-home-example .code-frame {
    border: 1px solid var(--reified-border) !important;
}

.docs-home-example code {
    font-size: 0.9rem;
    line-height: 1.55;
    white-space: pre;
}

.reified-landing .btn-primary {
    border-radius: var(--reified-radius);
    border-color: var(--reified-accent);
    background: var(--reified-accent);
    color: #ffffff;
    font-weight: 600;
}

.reified-landing .btn-primary:hover {
    filter: brightness(0.9);
}

.reified-landing table {
    width: auto !important;
    max-width: 78ch;
    margin: 2.5rem auto 1.5rem;
    border: 1px solid var(--reified-border);
    border-radius: var(--reified-radius);
    background: var(--reified-surface);
}

.reified-landing table th {
    background: var(--reified-surface-soft);
}

.docs-home-section-title {
    text-align: center;
}

.schema-overview-graphic {
    max-width: 680px;
    margin: 1.5rem auto;
}

.docs-home-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.65rem;
}

.docs-chip {
    display: inline-flex;
    align-items: center;
    min-height: 2.2rem;
    padding: 0.3rem 1rem;
    border: 1px solid var(--reified-border);
    border-radius: 999px;
    background: var(--reified-surface);
    color: var(--reified-muted);
    font-size: 0.92rem;
    font-weight: 500;
    text-decoration: none;
}

@media (max-width: 640px) {
    .docs-home-copy h1 {
        font-size: 2rem;
    }
}
