/*
  Cais approvals: dark only, a copy of the few Cais design tokens this page
  uses, as plain CSS. Fonts are self-hosted (OFL, see fonts/).
*/

@font-face {
    font-family: 'Inter Variable';
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url('fonts/inter-latin-wght-normal.woff2') format('woff2-variations');
}
@font-face {
    font-family: 'Instrument Serif';
    font-style: normal;
    font-display: swap;
    font-weight: 400;
    src: url('fonts/instrument-serif-latin-400-normal.woff2') format('woff2');
}
@font-face {
    font-family: 'Instrument Serif';
    font-style: italic;
    font-display: swap;
    font-weight: 400;
    src: url('fonts/instrument-serif-latin-400-italic.woff2') format('woff2');
}
@font-face {
    font-family: 'IBM Plex Mono';
    font-style: normal;
    font-display: swap;
    font-weight: 400;
    src: url('fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2');
}
@font-face {
    font-family: 'IBM Plex Mono';
    font-style: normal;
    font-display: swap;
    font-weight: 500;
    src: url('fonts/ibm-plex-mono-latin-500-normal.woff2') format('woff2');
}

:root {
    color-scheme: dark;
    --background: #121212;
    --card: #171717;
    --tile: #1a1a1a;
    --well: #1b1a18;
    --foreground: #ededea;
    --muted-foreground: #9a9894;
    --border: #272624;
    --border-strong: #3d3b38;
    --brand: #d97757;
    --radius: 4px;
    --radius-frame: 12px;
    --radius-frame-inner: 8px;
    --font-serif: 'Instrument Serif', Georgia, serif;
    --font-sans: 'Inter Variable', ui-sans-serif, system-ui, sans-serif;
    --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
}

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

html,
body {
    margin: 0;
    min-height: 100%;
    background: var(--card);
    color: var(--foreground);
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
}

/* Type roles (Cais): serif only at 28px and up, mono for labels, ids and code. */
.type-display {
    font-family: var(--font-serif);
    font-size: 40px;
    line-height: 0.95;
    font-weight: 400;
    letter-spacing: -0.025em;
    margin: 0;
}
.type-display em {
    font-style: italic;
    color: var(--muted-foreground);
}
.type-title {
    font-size: 15px;
    line-height: 21px;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin: 0;
}
.type-body {
    font-size: 14px;
    line-height: 1.55;
    margin: 0;
}
.type-small {
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
}
.type-label {
    font-family: var(--font-mono);
    font-size: 11px;
    line-height: 16px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.type-code {
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.5;
}
.type-code-sm {
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.5;
}
.muted {
    color: var(--muted-foreground);
}
.exposed {
    color: var(--brand);
}

.page {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 640px;
    margin: 0 auto;
    padding: 48px 20px 64px;
}

.mark {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

/* The dual-border frame: 12px outside, 8px inside. */
.frame {
    min-width: 0;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-frame);
    padding: 4px;
}
.frame > .inner {
    display: flex;
    flex-direction: column;
    gap: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-frame-inner);
    background: var(--tile);
    padding: 20px;
    min-width: 0;
}

/* Long ids and hashes wrap anywhere rather than widen the page. */
.wrap {
    overflow-wrap: anywhere;
}

.rows {
    display: grid;
    grid-template-columns: minmax(7rem, auto) 1fr;
    margin: 0;
}
.rows > dt,
.rows > dd {
    margin: 0;
    padding: 10px 0;
    border-top: 1px solid var(--border);
}
.rows > dd {
    overflow-wrap: anywhere;
}
.row-lead {
    display: block;
    margin-bottom: 2px;
}

.canonical {
    margin: 0;
    padding: 14px 16px;
    border-radius: var(--radius);
    background: var(--well);
    overflow-x: auto;
    white-space: pre;
}

/* One primary button, then the plain one. Buttons don't lift. */
.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.button {
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: transparent;
    color: var(--foreground);
    font: 500 14px/1 var(--font-sans);
    cursor: pointer;
}
.button.primary {
    border-color: var(--foreground);
    background: var(--foreground);
    color: var(--background);
}
.button:disabled {
    opacity: 0.5;
    cursor: default;
}
.button:focus-visible,
.foot a:focus-visible {
    outline: 2px solid var(--foreground);
    outline-offset: 2px;
}
.foot a {
    color: inherit;
}

.foot {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
}

@media (max-width: 420px) {
    .page {
        padding: 32px 16px 48px;
    }
    .rows {
        grid-template-columns: 1fr;
    }
    .rows > dd {
        border-top: 0;
        padding-top: 0;
    }
}
