/*
  SHIP-OS adaptive semantic design tokens.
  Load before style.css, design-v3.css, route CSS, and Tailwind output.
  Components consume semantic roles; these primitives are the only active
  product palette source. Print surfaces intentionally override to light.
*/
:root {
    color-scheme: light dark;

    /* Canonical rocket identity */
    --ship-brand-navy: #172033;
    --ship-brand-navy-deep: #101828;
    --ship-brand-navy-mid: #243048;
    --ship-brand-blue: #0f5ea8;
    --ship-brand-blue-hover: #0b4f8f;
    --ship-brand-blue-soft: #7aa2ff;
    --ship-brand-gold: #f4b804;
    --ship-brand-gold-strong: #f8c01c;
    --ship-on-brand-gold: #172033;

    /* Interaction */
    --ship-action: #0f5ea8;
    --ship-action-hover: #0b4f8f;
    --ship-on-action: #ffffff;
    --ship-link: #0f5ea8;
    --ship-link-dark: #7aa2ff;
    --ship-selected: #0f5ea8;
    --ship-selected-muted: #e5f0fb;
    --ship-focus-ring: #0f5ea8;

    /* Surfaces */
    --ship-canvas: #edf2fa;
    --ship-canvas-top: #f6faff;
    --ship-canvas-bottom: #edf2fa;
    --ship-surface: #ffffff;
    --ship-surface-elevated: #ffffff;
    --ship-surface-muted: #f6faff;
    --ship-control-fill: #edf2fa;
    --ship-action-bar: #f6faff;
    --ship-border-subtle: #d6e1f1;
    --ship-border-strong: #7d8da8;
    --ship-divider: #d6e1f1;

    /* Text */
    --ship-text-primary: #0f172b;
    --ship-text-secondary: #31405f;
    --ship-text-tertiary: #5f6f8f;
    --ship-text-inverse: #ffffff;

    /* Semantic status: foreground / background / border */
    --ship-success: #166534;
    --ship-success-bg: #e8f7ee;
    --ship-success-border: #9fd8b6;
    --ship-warning: #854d0e;
    --ship-warning-bg: #fff4db;
    --ship-warning-border: #e7c56d;
    --ship-danger: #b42318;
    --ship-danger-bg: #fdecea;
    --ship-danger-border: #f0aea8;
    --ship-info: #0f5ea8;
    --ship-info-bg: #e5f0fb;
    --ship-info-border: #9bc1e7;
    --ship-neutral: #475569;
    --ship-neutral-bg: #eef2f7;
    --ship-neutral-border: #cbd5e1;
    --ship-ambiguous: #6b3fa0;
    --ship-ambiguous-bg: #f2e9ff;
    --ship-ambiguous-border: #c9adeb;

    /* Compatibility roles; do not add new consumers. */
    --ship-primary: var(--ship-action);
    --ship-primary-dark: var(--ship-action-hover);
    --ship-primary-light: var(--ship-brand-blue-soft);
    --ship-background: var(--ship-canvas);
    --ship-foreground: var(--ship-text-primary);
    --ship-foreground-muted: var(--ship-text-secondary);
    --ship-border: var(--ship-border-subtle);

    /* Spacing (4/8 rhythm) */
    --ship-space-1: 0.25rem;
    --ship-space-2: 0.5rem;
    --ship-space-3: 0.75rem;
    --ship-space-4: 1rem;
    --ship-space-5: 1.25rem;
    --ship-space-6: 1.5rem;
    --ship-space-8: 2rem;

    /* Web radii; native adapters keep their platform role scale. */
    --ship-radius-sm: 0.25rem;
    --ship-radius-md: 0.5rem;
    --ship-radius-lg: 0.75rem;
    --ship-radius-card: 1rem;
    --ship-radius-pill: 9999px;

    --ship-shadow-xs: 0 1px 2px rgb(23 32 51 / 0.06);
    --ship-shadow-sm: 0 1px 3px rgb(23 32 51 / 0.10), 0 1px 2px rgb(23 32 51 / 0.06);
    --ship-shadow-md: 0 4px 10px rgb(23 32 51 / 0.12);

    /* Touch target minimum */
    --ship-touch-target: 2.75rem;
}

@media (prefers-color-scheme: dark) {
    :root {
        --ship-link: #7aa2ff;
        --ship-selected-muted: #253b61;
        --ship-focus-ring: #7aa2ff;

        --ship-canvas: #101828;
        --ship-canvas-top: #101828;
        --ship-canvas-bottom: #172033;
        --ship-surface: #182038;
        --ship-surface-elevated: #243048;
        --ship-surface-muted: #2f3d58;
        --ship-control-fill: #2f3d58;
        --ship-action-bar: #243048;
        --ship-border-subtle: #465879;
        --ship-border-strong: #6f84a8;
        --ship-divider: #465879;

        --ship-text-primary: #eef2fb;
        --ship-text-secondary: #a8b4cc;
        --ship-text-tertiary: #8d9bb8;

        --ship-success: #75e0a7;
        --ship-success-bg: #173a2a;
        --ship-success-border: #2d7255;
        --ship-warning: #ffd080;
        --ship-warning-bg: #4a3212;
        --ship-warning-border: #805e1f;
        --ship-danger: #ff9b94;
        --ship-danger-bg: #482423;
        --ship-danger-border: #7f3833;
        --ship-info: #7aa2ff;
        --ship-info-bg: #24375c;
        --ship-info-border: #46669c;
        --ship-neutral: #c4cedf;
        --ship-neutral-bg: #2f3d58;
        --ship-neutral-border: #596b89;
        --ship-ambiguous: #d2b7ff;
        --ship-ambiguous-bg: #362950;
        --ship-ambiguous-border: #72579a;

        --ship-shadow-xs: 0 1px 2px rgb(0 0 0 / 0.22);
        --ship-shadow-sm: 0 2px 6px rgb(0 0 0 / 0.28);
        --ship-shadow-md: 0 8px 18px rgb(0 0 0 / 0.32);
    }
}

@media print {
    :root {
        color-scheme: light;
        --ship-canvas: #ffffff;
        --ship-canvas-top: #ffffff;
        --ship-canvas-bottom: #ffffff;
        --ship-surface: #ffffff;
        --ship-surface-elevated: #ffffff;
        --ship-surface-muted: #f6faff;
        --ship-control-fill: #edf2fa;
        --ship-action-bar: #f6faff;
        --ship-text-primary: #0f172b;
        --ship-text-secondary: #31405f;
        --ship-text-tertiary: #5f6f8f;
        --ship-border-subtle: #d6e1f1;
        --ship-border-strong: #7d8da8;
        --ship-divider: #d6e1f1;
        --ship-success: #166534;
        --ship-success-bg: #e8f7ee;
        --ship-success-border: #9fd8b6;
        --ship-warning: #854d0e;
        --ship-warning-bg: #fff4db;
        --ship-warning-border: #e7c56d;
        --ship-danger: #b42318;
        --ship-danger-bg: #fdecea;
        --ship-danger-border: #f0aea8;
        --ship-info: #0f5ea8;
        --ship-info-bg: #e5f0fb;
        --ship-info-border: #9bc1e7;
        --ship-neutral: #475569;
        --ship-neutral-bg: #eef2f7;
        --ship-neutral-border: #cbd5e1;
        --ship-ambiguous: #6b3fa0;
        --ship-ambiguous-bg: #f2e9ff;
        --ship-ambiguous-border: #c9adeb;
    }
}
