/* ============================================================
 * Tiptree Docs adapter
 *
 * The build emits the pinned design-system primitives and
 * themes/dark-default.css before this file. Dark therefore lives on
 * :root and light on [data-theme='light']; this file must not reverse
 * that sanctioned polarity.
 *
 * Consumer names stay stable while their values flow from --tt-*.
 * Color and shadow values which do not yet have a design ruling are
 * isolated below instead of being silently changed.
 * ============================================================ */

:root {
    /* --------------------------------------------------------
     * LIVE DESIGN-SYSTEM ADAPTER — 52 audited product bindings.
     * -------------------------------------------------------- */
    --action-accent-bg: var(--tt-brand-teal-dark);
    --action-accent-fg: var(--tt-brand-white);
    --action-primary-bg: var(--tt-color-button-invert-bg);
    --action-secondary-bg: var(--tt-color-button-secondary-bg);
    --action-secondary-border: var(--tt-color-button-secondary-border);
    --border-default: var(--tt-color-border-primary);
    --border-interactive: var(--tt-color-border-interactive);
    --brand-dark-blue: var(--tt-brand-teal-dark);
    --brand-light-blue: var(--tt-brand-teal-light);
    --brand-white: var(--tt-brand-white);
    --citron-200: var(--tt-citron-200);
    --citron-300: var(--tt-citron-300);
    --citron-400: var(--tt-citron-400);
    --citron-700: var(--tt-citron-700);
    --citron-900: var(--tt-citron-900);
    --color-accent: var(--tt-color-accent);
    --color-highlight: var(--tt-color-highlight);
    --shadow-elevated: var(--tt-shadow-high);
    --shadow-md: var(--tt-shadow-medium);
    --shadow-sm: var(--tt-shadow-low);
    --stone-000: var(--tt-stone-000);
    --stone-050: var(--tt-stone-050);
    --stone-1000: var(--tt-stone-1000);
    --stone-150: var(--tt-stone-150);
    --stone-200: var(--tt-stone-200);
    --stone-350: var(--tt-stone-350);
    --stone-400: var(--tt-stone-400);
    --stone-450: var(--tt-stone-450);
    --stone-500: var(--tt-stone-500);
    --stone-550: var(--tt-stone-550);
    --stone-600: var(--tt-stone-600);
    --stone-700: var(--tt-stone-700);
    --stone-850: var(--tt-stone-850);
    --stone-875: var(--tt-stone-875);
    --stone-900: var(--tt-stone-900);
    --stone-950: var(--tt-stone-950);
    --status-running: var(--tt-color-status-info-fg);
    --status-success: var(--tt-color-status-success-fg);
    --scrollbar-thumb: var(--tt-color-scrollbar-thumb);
    --surface-canvas: var(--tt-color-bg-primary);
    --surface-raised: var(--tt-color-surface-card);
    --teal-200: var(--tt-teal-200);
    --teal-300: var(--tt-teal-300);
    --teal-400: var(--tt-teal-400);
    --teal-600: var(--tt-teal-600);
    --teal-700: var(--tt-teal-700);
    --teal-800: var(--tt-teal-800);
    --teal-900: var(--tt-teal-900);
    --text-primary: var(--tt-color-text-primary);
    --text-quaternary: var(--tt-color-text-quaternary);
    --text-secondary: var(--tt-color-text-secondary);
    --text-tertiary: var(--tt-color-text-tertiary);

    /* --------------------------------------------------------
     * APP-LOCAL TYPOGRAPHY AND GEOMETRY — outside this audit.
     * -------------------------------------------------------- */
    --font-weight-normal: 400;
    --font-weight-medium: 510;
    --font-weight-semibold: 590;
    --font-variations: 'opsz' auto;
    --font-family-sans:
        inter, 'inter Fallback', 'SF Pro Display', -apple-system, blinkmacsystemfont, 'Segoe UI', arial, sans-serif;
    --font-family-serif: literata, 'Literata Fallback', georgia, serif;
    --font-family-label-mono:
        inter, 'inter Fallback', ui-monospace, sfmono-regular, 'SF Mono', menlo, monospace;
    --font-family-code-mono:
        'Google Sans Code', ui-monospace, sfmono-regular, 'SF Mono', menlo, monaco, consolas, monospace;
    --text-regular-size: 0.9375rem;
    --text-regular-line-height: 1.5;
    --text-small-size: 0.875rem;
    --text-small-line-height: calc(21 / 14);
    --text-mini-size: 0.8125rem;
    --text-mini-line-height: 1.5;
    --text-mini-letter-spacing: -0.01em;
    --text-micro-size: 0.75rem;
    --text-micro-line-height: 1.4;
    --text-micro-letter-spacing: 0;
    --heading-page-family: var(--font-family-serif);
    --heading-page-size: 2.5rem;
    --heading-page-line-height: 1.2;
    --heading-page-letter-spacing: -0.02em;
    --heading-page-weight: 300;
    --heading-section-family: var(--font-family-serif);
    --heading-section-size: 1.375rem;
    --heading-section-line-height: 1.33;
    --heading-section-letter-spacing: -0.01em;
    --heading-section-weight: 400;
    --heading-sub-family: var(--font-family-sans);
    --heading-sub-size: 1.0625rem;
    --heading-sub-line-height: 1.4;
    --heading-sub-letter-spacing: -0.012em;
    --heading-sub-weight: 400;       /* 500 -> 400 */
    --underline-thickness: clamp(1px, 0.0625em, 3px);
    --underline-offset: clamp(2px, 0.225em, 6px);
    --border-hairline: 1px;
    --radius-sm: 6px;
    --radius-full: 999px;
    --z-header: 1001;
    --z-popover: 1100;
    --z-settings-modal: 1500;
    --z-max: 10001;

    /* --------------------------------------------------------
     * APP-LOCAL COLORS AND SHADOWS — 3 registered residuals.
     * Dispositions are recorded in the 2026-08-19 ruling amendment.
     * -------------------------------------------------------- */
    /* held for graduation */
    --action-primary-bg-hover: var(--tt-brand-white);
    /* ruled docs-local 2026-08-19 */
    --action-secondary-bg-hover: #30302e;
    /* ruled docs-local 2026-08-19 */
    --shadow-xs: 0 0 0 transparent;
}

@supports (text-decoration-thickness: from-font) {
    :root {
        --underline-thickness: from-font;
    }
}

@media (resolution >= 192dpi) {
    :root {
        --border-hairline: 0.5px;
    }
}

[data-theme='light'] {
    /* Live aliases whose docs-specific values differ in light mode. */
    --status-running: var(--tt-color-blue);
    --status-success: var(--tt-color-green);

    /* The same 3 registered residuals, with their light values preserved. */
    --action-primary-bg-hover: var(--tt-stone-750);
    --action-secondary-bg-hover: var(--tt-stone-150);
    --shadow-xs: 0 1px 2px 0 #00000012;
}
