/*
  Shared theme for the MCP landing page (/mcp) and the OAuth consent screen
  (templates/oauth2_provider/authorize.html).

  Sections:
    1. Tokens        - colours, radii, fonts (Kolibri-inspired light palette).
    2. Base          - reset, body, typography.
    3. Primitives    - .button, .pill, .eyebrow, .card.

  Keep token values in sync with @kolonialno/kolibri-design-tokens when the
  brand palette changes.
*/

/* Oda uses Inter. Mathem uses ABC Ginto. */
@font-face {
    font-family: 'Inter var';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('Inter-roman.var.woff2') format('woff2');
}

@font-face {
    font-family: 'ABC Ginto';
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url('ABCGintoVariable.woff2') format('woff2');
}

/* 1. Tokens ---------------------------------------------------------------- */

:root {
    color-scheme: light;

    --bg: #fbf8f3;
    --bg-elevated: #fff;
    --surface: #fff;
    --surface-strong: #f3eee6;
    --surface-inset: #ebe4da;
    --border: #d8d2cb;
    --border-strong: #c3bdb6;

    --text: #190f24;
    --text-display: #280f3c;
    --text-muted: #484541;
    --text-faint: #6b6560;

    --accent: #ffa424;
    --accent-hover: #e89b1b;
    --accent-ink: #17001e;
    --accent-2: #7734b9;
    --accent-3: #0d7a6f;
    --critical: #8d1c16;
    --critical-surface: #fbeae9;

    --radius-s: 10px;
    --radius-m: 18px;
    --radius-l: 28px;
    --radius-full: 999px;

    --font-sans:
        'Inter var', Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-mono:
        'SF Mono', 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
}

[data-tenant='se'] {
    --font-sans: 'ABC Ginto', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* 2. Base ------------------------------------------------------------------ */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
    margin: 0 0 0.5em;
    line-height: 1.15;
    letter-spacing: -0.02em;
    font-weight: 650;
    color: var(--text-display);
}

h1 {
    font-size: clamp(2.25rem, 6vw, 4rem);
}
h2 {
    font-size: clamp(1.6rem, 3.5vw, 2.25rem);
}
h3 {
    font-size: 1.1rem;
}

p {
    margin: 0 0 1rem;
}

a {
    color: inherit;
}

code {
    font-family: var(--font-mono);
    font-size: 0.9em;
}

:focus-visible {
    outline: 2px solid var(--accent-2);
    outline-offset: 3px;
    border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

/* 3. Primitives ------------------------------------------------------------ */

.eyebrow {
    margin: 0 0 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
}

.pill-logo {
    width: 1.125rem;
    height: 1.125rem;
    flex-shrink: 0;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.8rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-strong);
    background: var(--surface-strong);
    font-size: 0.85rem;
    color: var(--text);
}

.lang-picker {
    display: inline-flex;
    align-items: center;
    flex: none;
    padding: 3px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-strong);
    background: var(--surface);
}

.lang-picker a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    min-height: 1.625rem;
    padding: 0 0.55rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    color: var(--text-muted);
}

.lang-picker a[aria-current='true'] {
    background: var(--text);
    color: var(--bg);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.4rem;
    font: inherit;
    font-weight: 600;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-strong);
    background: var(--bg-elevated);
    color: var(--accent-2);
    text-decoration: none;
    cursor: pointer;
    transition: background 120ms ease;
}

.button:hover {
    background: var(--surface-strong);
}

.button.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
}

.button.primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.card {
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-m);
    border: 1px solid var(--border);
    background: var(--surface);
}

.muted {
    color: var(--text-muted);
}
.faint {
    color: var(--text-faint);
    font-size: 0.85rem;
}

.errors {
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border-radius: var(--radius-s);
    background: var(--critical-surface);
    color: var(--critical);
}
