/*
 * Purpose: Base typography, focus, and `prefers-reduced-motion`
 *          guard. Loaded AFTER `kinetic/tokens.css`, `fonts.css`,
 *          and `kinetic/reset.css`. Sets the body baseline and
 *          the global focus ring style for the entire admin
 *          surface. Phase 1+ add layout rules; Phase 2 adds
 *          component rules.
 */

body {
    font-family: var(--gp-font-body);
    font-size: clamp(0.875rem, 0.9vw, 1rem);
    line-height: 1.4;
    color: var(--gp-fg);
    background: var(--gp-bg);
    letter-spacing: -0.01em;
    font-weight: 400;
}

h1, h2, h3, h4, h5, h6,
.k-h1, .k-h2, .k-h3, .k-h4, .k-h5, .k-h6 {
    font-family: var(--gp-font-display);
    font-weight: 700;
    color: var(--gp-fg);
    text-transform: uppercase;
    letter-spacing: -0.04em;
    line-height: 0.9;
    margin: 0 0 var(--gp-sp-4);
}

h1, .k-h1 { font-size: clamp(2rem, 4vw, 3.5rem); }
h2, .k-h2 { font-size: clamp(1.75rem, 3.5vw, 2.75rem); }
h3, .k-h3 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h4, .k-h4 { font-size: clamp(1.25rem, 2vw, 1.75rem); }
h5, .k-h5 { font-size: clamp(1rem, 1.5vw, 1.25rem); }
h6, .k-h6 { font-size: 0.875rem; letter-spacing: 0.1em; }

p, .k-body {
    font-family: var(--gp-font-body);
    font-size: clamp(0.875rem, 1vw, 1rem);
    line-height: 1.5;
    color: var(--gp-fg);
    margin: 0 0 var(--gp-sp-4);
}

.k-eyebrow {
    display: block;
    font-family: var(--gp-font-display);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--gp-muted-foreground);
    font-weight: 500;
    margin-bottom: var(--gp-sp-2);
}

.k-meta {
    font-size: 0.875rem;
    color: var(--gp-muted-foreground);
}

code, pre, .k-code {
    font-family: var(--gp-font-mono);
    font-size: 0.875rem;
    color: var(--gp-fg);
    background: var(--gp-muted);
    padding: 0.125rem 0.375rem;
}

pre, .k-code-block {
    background: var(--gp-muted);
    color: var(--gp-fg);
    padding: var(--gp-sp-4);
    overflow-x: auto;
    font-size: 0.875rem;
    line-height: 1.5;
}

a {
    color: var(--gp-accent);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--gp-dur) var(--gp-ease);
}

a:hover,
a:focus {
    color: var(--gp-fg);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

hr {
    border: 0;
    border-top: var(--gp-border-w) solid var(--gp-border);
    margin: var(--gp-sp-8) 0;
    opacity: 1;
}

/* Global focus ring: 2px acid-yellow with a 2px black offset so
   it remains visible on the acid-yellow active state of buttons
   (§2.1.1 + accessibility §12). */
:focus {
    outline: none;
}

:focus-visible,
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--gp-accent);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px var(--gp-bg);
}

/* Reduced motion: kill every transition / animation unless the
   rule explicitly opts back in via `prefers-reduced-motion:
   no-preference`. */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }
}
