/* ==========================================================================
   shib.me - Design tokens & base styles

   Tokens are deliberately identical to xipher.org's base.css so that shib.me,
   xipher.org and slv.sh read as one design system. Keep them in sync.
   ========================================================================== */

:root {
    /* Brand */
    --brand-1: #00ddff;
    --brand-2: #0044ff;
    --brand-gradient: linear-gradient(135deg, #00ddff, #0044ff);

    /* Surfaces */
    --bg-color: #eef2f7;
    --bg-accent: radial-gradient(1200px 600px at 50% -10%, rgba(0, 132, 255, 0.10), transparent 60%);
    --surface-color: #ffffff;
    --surface-2: #f5f8fc;

    /* Text */
    --text-color: #1c2430;
    --text-muted: #5a6677;
    --text-faint: #8a96a8;

    /* Lines */
    --border-color: #d7dee8;
    --border-strong: #c2ccd9;

    /* Status */
    --success-color: #1faa53;
    --accent-warm: #f0820e;

    /* Effects */
    --shadow-sm: 0 1px 3px rgba(16, 30, 54, 0.08);
    --shadow-md: 0 6px 20px rgba(16, 30, 54, 0.10);
    --shadow-lg: 0 18px 50px rgba(16, 30, 54, 0.18);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-pill: 999px;

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

    --ease: cubic-bezier(0.4, 0, 0.2, 1);

    /* Local to this site (not in xipher's token set) */
    --measure: 68ch;
    --gutter: 24px;
    /* --brand-gradient starts at #00ddff, which is lovely on a dark
       background and unreadable on a light one. This is the same ramp with
       the pale end cut off, for anything that carries text. */
    --accent-ramp: linear-gradient(135deg, #0072b8, #0044ff);
}

/* Dark values live in two places on purpose: the attribute selector for the
   explicit toggle, and the media query for visitors with JavaScript off (where
   nothing is around to set data-theme). Plain CSS can't share one block
   between the two, so keep the pair in sync. */

[data-theme="dark"] {
    --bg-color: #0b0e14;
    --bg-accent: radial-gradient(1200px 600px at 50% -10%, rgba(0, 132, 255, 0.16), transparent 60%);
    --surface-color: #151a23;
    --surface-2: #1b212c;

    --text-color: #e7ecf3;
    --text-muted: #a3afc0;
    --text-faint: #6c7888;

    --border-color: #2a323f;
    --border-strong: #38424f;

    --success-color: #36d177;
    --accent-warm: #ffa726;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 20px 55px rgba(0, 0, 0, 0.6);

    --accent-ramp: var(--brand-gradient);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        --bg-color: #0b0e14;
        --bg-accent: radial-gradient(1200px 600px at 50% -10%, rgba(0, 132, 255, 0.16), transparent 60%);
        --surface-color: #151a23;
        --surface-2: #1b212c;

        --text-color: #e7ecf3;
        --text-muted: #a3afc0;
        --text-faint: #6c7888;

        --border-color: #2a323f;
        --border-strong: #38424f;

        --success-color: #36d177;
        --accent-warm: #ffa726;

        --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
        --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
        --shadow-lg: 0 20px 55px rgba(0, 0, 0, 0.6);

        --accent-ramp: var(--brand-gradient);
    }
}

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    /* Keep deep-linked headings clear of the sticky topbar. */
    scroll-padding-top: 88px;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    min-height: 100dvh;
    line-height: 1.6;
    /* Nothing on the page is wide enough to need this, but it costs nothing and
       stops a long URL or token from ever pushing the page sideways. */
    overflow-wrap: break-word;
    transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* The radial accent sits on its own fixed layer rather than on body with
   background-attachment: fixed, which iOS Safari ignores. There it would
   scroll away with the content instead of staying where it was put. */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: var(--bg-accent);
}

h1,
h2,
h3,
h4 {
    line-height: 1.2;
    letter-spacing: -0.015em;
    margin: 0;
}

p {
    margin: 0;
}

a {
    color: inherit;
}

ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

code,
kbd,
samp,
pre {
    font-family: var(--font-mono);
    font-size: 0.9em;
}

button {
    font-family: inherit;
}

img,
svg {
    display: block;
    max-width: 100%;
}

::selection {
    background: rgba(10, 132, 255, 0.25);
}

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

/* Skip link, visible only when focused. */
.skip-link {
    position: absolute;
    left: 50%;
    top: 0;
    transform: translate(-50%, -150%);
    z-index: 100;
    padding: 10px 18px;
    background: var(--surface-color);
    border: 1px solid var(--border-strong);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    box-shadow: var(--shadow-md);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s var(--ease);
}

.skip-link:focus {
    transform: translate(-50%, 0);
}

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

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