/* Shared by every page of workfile.illodev.com. The landing adds its own
   sections inline; the docs and comparison pages use only this file. */

@font-face {
    font-family: "Geist Variable";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url(/assets/geist-latin-wght-normal.woff2) format("woff2-variations");
}
@font-face {
    font-family: "Geist Mono Variable";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url(/assets/geist-mono-latin-wght-normal.woff2) format("woff2-variations");
}

:root {
    --paper: oklch(0.982 0.002 264);
    --ink: oklch(0.18 0.012 264);
    --dim: oklch(0.46 0.014 264);
    --rule: oklch(0.88 0.006 264);
    --card: oklch(0.995 0.001 264);
    --accent: #3149d4;
    /* The flood is the brand blue in both schemes: white on it is 6.9:1. */
    --blue: #3149d4;
    --on-blue: #ffffff;
    --on-blue-dim: rgb(255 255 255 / 0.82);
    --night: oklch(0.17 0.014 264);
    --on-night: oklch(0.96 0.003 264);
    --on-night-dim: oklch(0.75 0.012 264);
    --night-accent: oklch(0.78 0.12 264);
    --sans: "Geist Variable", system-ui, -apple-system, "Segoe UI", sans-serif;
    --mono: "Geist Mono Variable", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    --gutter: clamp(16px, 4vw, 40px);
    --bar: 52px;
    color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
    :root {
        --paper: oklch(0.155 0.008 264);
        --ink: oklch(0.96 0.003 264);
        --dim: oklch(0.71 0.012 264);
        --rule: oklch(0.29 0.012 264);
        --card: oklch(0.19 0.009 264);
        --accent: oklch(0.76 0.13 264);
        --night: oklch(0.105 0.01 264);
    }
}

*,
*::before,
*::after {
    box-sizing: border-box;
}
html {
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: calc(var(--bar) + 16px);
}
body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 16px/1.6 var(--sans);
    -webkit-font-smoothing: antialiased;
}
a {
    color: inherit;
    text-decoration-color: color-mix(in oklch, currentColor 35%, transparent);
    text-underline-offset: 3px;
}
a:hover {
    color: var(--accent);
    text-decoration-color: currentColor;
}
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}
code,
pre,
kbd {
    font-family: var(--mono);
}
img,
video {
    display: block;
    max-width: 100%;
    height: auto;
}
.skip {
    position: absolute;
    left: -9999px;
}
.skip:focus {
    left: 16px;
    top: 8px;
    z-index: 100;
    background: var(--ink);
    color: var(--paper);
    padding: 6px 10px;
}

/* Bar ------------------------------------------------------------------ */
.bar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: color-mix(in oklch, var(--paper) 90%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--rule);
}
.bar-in {
    display: flex;
    align-items: center;
    gap: 10px 22px;
    min-height: var(--bar);
    max-width: 1440px;
    margin-inline: auto;
    padding-inline: var(--gutter);
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-right: auto;
    color: var(--ink);
    font: 600 15px/1 var(--mono);
    letter-spacing: -0.02em;
    text-decoration: none;
}
.brand svg {
    width: 22px;
    height: 22px;
    color: var(--accent);
}
.bar-nav {
    display: flex;
    gap: 18px;
    font: 13px/1 var(--mono);
}
.bar-nav a {
    color: var(--dim);
    text-decoration: none;
}
.bar-nav a:hover,
.bar-nav a[aria-current] {
    color: var(--accent);
}

/* On a phone the bar is one row and the links fold into a panel under it.
   Only when script runs: without it `.js` is never set, the button stays
   hidden and the links wrap in the bar as before, so nothing is unreachable. */
.menu-toggle {
    display: none;
}
@media (max-width: 760px) {
    .bar-in {
        position: relative;
        flex-wrap: nowrap;
        gap: 10px;
    }
    .js .menu-toggle {
        display: inline-flex;
        flex: none;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 34px;
        padding: 0;
        border: 1px solid var(--rule);
        background: none;
        color: var(--ink);
        cursor: pointer;
    }
    .menu-icon,
    .menu-icon::before,
    .menu-icon::after {
        display: block;
        width: 16px;
        height: 1.5px;
        background: currentColor;
        transition: transform 0.18s ease, background-color 0.18s ease;
    }
    .menu-icon {
        position: relative;
    }
    .menu-icon::before,
    .menu-icon::after {
        content: "";
        position: absolute;
        left: 0;
    }
    .menu-icon::before {
        top: -5px;
    }
    .menu-icon::after {
        top: 5px;
    }
    .bar[data-menu="open"] .menu-icon {
        background-color: transparent;
    }
    .bar[data-menu="open"] .menu-icon::before {
        transform: translateY(5px) rotate(45deg);
    }
    .bar[data-menu="open"] .menu-icon::after {
        transform: translateY(-5px) rotate(-45deg);
    }
    .js .bar-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        gap: 0;
        padding-inline: var(--gutter);
        padding-block: 4px 12px;
        border-bottom: 1px solid var(--rule);
        background: var(--paper);
        box-shadow: 0 18px 32px -22px rgb(0 0 0 / 0.35);
        font-size: 15px;
    }
    .js .bar[data-menu="open"] .bar-nav {
        display: flex;
    }
    .js .bar-nav a {
        display: flex;
        justify-content: space-between;
        padding: 15px 0;
        border-bottom: 1px solid var(--rule);
        color: var(--ink);
    }
    .js .bar-nav a:last-child {
        border-bottom: 0;
    }
    .js .bar-nav a::after {
        content: "→";
        color: var(--accent);
    }
    .js .bar-nav a[aria-current] {
        color: var(--accent);
    }
}
@media (max-width: 760px) and (prefers-reduced-motion: reduce) {
    .menu-icon,
    .menu-icon::before,
    .menu-icon::after {
        transition: none;
    }
}

/* Docs and comparison pages --------------------------------------------- */
.page-grid {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 56px;
    max-width: 1440px;
    margin-inline: auto;
    padding-inline: var(--gutter);
}
.side {
    position: sticky;
    top: var(--bar);
    align-self: start;
    max-height: calc(100vh - var(--bar));
    overflow: auto;
    padding-block: 32px;
    font: 13px/1.45 var(--mono);
}
.side-label {
    margin: 0 0 8px;
    color: var(--accent);
}
.side ol {
    list-style: none;
    margin: 0 0 28px;
    padding: 0;
}
.side li a {
    display: block;
    padding: 4px 0 4px 12px;
    border-left: 1px solid var(--rule);
    color: var(--dim);
    text-decoration: none;
}
.side li a:hover {
    color: var(--accent);
}
.side li a[aria-current] {
    padding-left: 11px;
    border-left: 2px solid var(--accent);
    color: var(--ink);
    font-weight: 600;
}
.side ol ol {
    margin: 4px 0 10px 12px;
}
.side ol ol a {
    font-size: 12px;
    border-left-style: dotted;
}
.side ol ol code {
    font-size: inherit;
}
.page-main {
    min-width: 0;
    max-width: 820px;
    padding-block: 32px 96px;
}
.twin {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    margin: 0 0 32px;
    padding: 10px 14px;
    border: 1px dashed var(--rule);
    color: var(--dim);
    font: 12.5px/1.5 var(--mono);
}
.twin a {
    color: var(--accent);
}
.checked {
    margin: 0 0 28px;
    padding: 12px 16px;
    border-left: 3px solid var(--accent);
    background: var(--card);
    font: 13px/1.55 var(--mono);
    color: var(--dim);
}
.source {
    margin-top: 56px;
    color: var(--dim);
    font: 12.5px/1.5 var(--mono);
}

.prose {
    font-size: 16px;
    line-height: 1.7;
    overflow-wrap: break-word;
}
.prose h1 {
    margin: 0 0 24px;
    font: 640 clamp(34px, 5vw, 56px)/1.05 var(--sans);
    letter-spacing: -0.035em;
    text-wrap: balance;
}
.prose h2 {
    margin: 56px 0 14px;
    padding-top: 20px;
    border-top: 1px solid var(--rule);
    font: 600 26px/1.2 var(--sans);
    letter-spacing: -0.02em;
}
.prose h3 {
    margin: 36px 0 10px;
    font: 600 19px/1.3 var(--sans);
}
.prose h4 {
    margin: 28px 0 8px;
    font: 600 16px/1.4 var(--sans);
}
.hash {
    margin-right: 2px;
    color: var(--accent);
    font-family: var(--mono);
    font-weight: 400;
    text-decoration: none;
    opacity: 0.75;
}
.prose p,
.prose ul,
.prose ol {
    margin: 0 0 16px;
}
.prose ul,
.prose ol {
    padding-left: 22px;
}
.prose li {
    margin: 4px 0;
}
.prose :not(pre) > code {
    padding: 0.1em 0.35em;
    border: 1px solid var(--rule);
    border-radius: 3px;
    background: var(--card);
    font-size: 0.86em;
    overflow-wrap: anywhere;
}
.prose pre.code {
    position: relative;
    margin: 0 0 20px;
    padding: 16px 18px;
    overflow-x: auto;
    background: var(--night);
    color: var(--on-night);
    font-size: 13px;
    line-height: 1.65;
}
.prose pre.code[data-lang]::before {
    content: attr(data-lang);
    position: absolute;
    top: 0;
    right: 0;
    padding: 2px 8px;
    color: var(--on-night-dim);
    font-size: 11px;
}
.prose blockquote {
    margin: 0 0 16px;
    padding: 4px 0 4px 18px;
    border-left: 3px solid var(--accent);
    color: var(--dim);
}
.prose blockquote p:last-child {
    margin-bottom: 0;
}
.prose .table {
    margin: 0 0 20px;
    overflow-x: auto;
    border: 1px solid var(--rule);
}
.prose table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.prose th,
.prose td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--rule);
    text-align: left;
    vertical-align: top;
}
.prose th {
    background: var(--card);
    color: var(--dim);
    font: 600 12.5px/1.4 var(--mono);
}
.prose tr:last-child td {
    border-bottom: 0;
}
.prose hr {
    margin: 40px 0;
    border: 0;
    border-top: 1px solid var(--rule);
}

/* Footer ---------------------------------------------------------------- */
.foot {
    border-top: 1px solid var(--rule);
}
.foot-in {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 22px;
    align-items: baseline;
    max-width: 1440px;
    margin-inline: auto;
    padding-inline: var(--gutter);
    padding-block: 24px;
    color: var(--dim);
    font: 12.5px/1.5 var(--mono);
}
.foot-in span {
    margin-right: auto;
}
.foot a {
    color: var(--dim);
}

@media (max-width: 900px) {
    .page-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }
    .side {
        position: static;
        max-height: none;
        padding-block: 20px 4px;
        border-bottom: 1px solid var(--rule);
    }
    .side ol {
        display: flex;
        flex-wrap: wrap;
        gap: 2px 16px;
        margin-bottom: 16px;
    }
    .side ol ol {
        display: none;
    }
    .side li a,
    .side li a[aria-current] {
        padding: 2px 0;
        border: 0;
    }
    .side li a[aria-current] {
        text-decoration: underline;
        text-decoration-color: var(--accent);
    }
}
