/* Resets, focus rings, typography defaults, micro-utilities. */

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

html, body {
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Explicit hidden wins over display:flex/grid — without this any
 * page that sets a layout display value on a `[hidden]` element
 * would show it. Landed via PoC feedback. */
[hidden] {
    display: none !important;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    line-height: var(--leading-tight);
    font-weight: 600;
}

p {
    margin: 0;
}

a {
    color: var(--primary);
    text-decoration: none;
}

/* No underlines anywhere — links signal with color/weight; hover
   darkens instead (decided: the hover/active underline read as a
   glitch on arrow-links and button-shaped anchors). */
a:hover {
    filter: brightness(0.85);
}

button {
    font-family: inherit;
    cursor: pointer;
}

/* Visible-on-keyboard focus ring (Tab key) without the mouse-click ring. */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: var(--r-sm);
}

/* Soft fade-in for main content; reduces snap on navigation. */
main {
    animation: fade-in 0.18s ease-out;
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── micro-utilities ──────────────────────────────────────────── */

.muted        { color: var(--ink-muted); }
.small        { font-size: var(--text-sm); }
.tiny         { font-size: var(--text-xs); }
.mono         { font-family: var(--font-mono); }
.center-text  { text-align: center; }
.nowrap       { white-space: nowrap; }
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.error {
    background: var(--danger-tint);
    color: var(--danger);
    border: 1px solid #fecaca;
    border-radius: var(--r-md);
    padding: var(--s-3) var(--s-4);
    font-size: var(--text-sm);
}

.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
