/* ==========================================================================
   Silver Glass — main.css
   :root design tokens + base element styles.
   Authority: .agents/design/design-system.md (sections 2 and 3).
   Never hard-code a color here or in any component — add or reuse a token.
   ========================================================================== */

:root {
    /* --- Palette: white & silver ----------------------------------------- */
    --white: #ffffff;
    --silver-050: #f6f8fb;
    --silver-100: #eef1f6;
    --silver-200: #e2e7ee;
    --silver-300: #d2d9e3;
    --silver-400: #b9c2d0;
    --silver-500: #9aa6b8;
    --silver-600: #78859a;

    /* --- Ink: text -------------------------------------------------------- */
    --ink-900: #1b2430;
    --ink-700: #333f4f;
    --ink-500: #5a6676;
    --ink-400: #78859a;

    /* --- Accent & intent -------------------------------------------------- */
    --accent: #5b7189;
    --accent-strong: #3f5872;
    --accent-soft: rgba(91, 113, 137, .12);
    --sponsor: #d6336c;
    --sponsor-soft: rgba(214, 51, 108, .10);
    --ok: #1f7a54;
    --warn: #9a6b16;
    --danger: var(--sponsor);

    /* --- Transparent glass surfaces --------------------------------------- */
    --glass: rgba(255, 255, 255, .62);
    --glass-strong: rgba(255, 255, 255, .90);
    --glass-faint: rgba(255, 255, 255, .40);
    --glass-border: rgba(255, 255, 255, .75);
    --hairline: rgba(120, 133, 154, .28);
    --surface-solid: rgba(255, 255, 255, .98);
    --blur: saturate(160%) blur(14px);

    /* --- Shadows ---------------------------------------------------------- */
    --shadow-sm: 0 1px 2px rgba(27, 36, 48, .06), 0 2px 8px rgba(27, 36, 48, .05);
    --shadow-md: 0 6px 22px rgba(27, 36, 48, .10);
    --shadow-lg: 0 18px 48px rgba(27, 36, 48, .16);

    /* --- Geometry --------------------------------------------------------- */
    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 22px;
    --maxw: 1120px;
    --header-h: 64px;

    /* --- Type ------------------------------------------------------------- */
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
        Arial, "Noto Sans", sans-serif;
    --mono: ui-monospace, SFMono-Regular, "JetBrains Mono", "SF Mono", Menlo,
        Consolas, "Liberation Mono", monospace;
}

/* --- Reset ---------------------------------------------------------------- */

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

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

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.65;
    color: var(--ink-700);
    /* The fixed silver field: white highlights top-left and top-right, a light
       silver wash toward the bottom, over the base silver gradient. */
    background:
        radial-gradient(1100px 620px at 12% -8%, rgba(255, 255, 255, .95), transparent 60%),
        radial-gradient(900px 520px at 92% 2%, rgba(255, 255, 255, .80), transparent 62%),
        radial-gradient(1200px 700px at 50% 108%, var(--silver-300), transparent 65%),
        linear-gradient(160deg, var(--silver-100) 0%, #dbe1ea 100%);
    background-attachment: fixed;
    background-repeat: no-repeat;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Wide content scrolls inside its own container, never the page. */
    overflow-x: hidden;
}

/* --- Typography ----------------------------------------------------------- */

h1,
h2,
h3,
h4 {
    margin: 0 0 .6em;
    color: var(--ink-900);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -.015em;
}

h1 {
    font-size: clamp(1.85rem, 1.35rem + 2.1vw, 2.6rem);
}

h2 {
    font-size: clamp(1.35rem, 1.15rem + .85vw, 1.7rem);
}

h3 {
    font-size: 1.15rem;
}

h4 {
    font-size: 1rem;
}

p {
    margin: 0 0 1rem;
}

ul,
ol {
    margin: 0 0 1rem;
    padding-left: 1.35rem;
}

li {
    margin-bottom: .35rem;
}

li > ul,
li > ol {
    margin-top: .35rem;
}

strong,
b {
    color: var(--ink-900);
    font-weight: 650;
}

small {
    font-size: .875rem;
    color: var(--ink-500);
}

a {
    color: var(--accent-strong);
    text-decoration-color: var(--hairline);
    text-underline-offset: .18em;
    transition: color .15s ease, text-decoration-color .15s ease;
}

a:hover {
    color: var(--ink-900);
    text-decoration-color: currentColor;
}

hr {
    height: 1px;
    margin: 2rem 0;
    border: 0;
    background: var(--hairline);
}

img {
    max-width: 100%;
    height: auto;
}

::selection {
    background: var(--accent-soft);
    color: var(--ink-900);
}

/* --- Focus ---------------------------------------------------------------- */

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

/* Only suppress the ring for pointer users; keyboard users keep it. */
:focus:not(:focus-visible) {
    outline: none;
}

/* --- Motion --------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/* --- Utilities ------------------------------------------------------------ */

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