/*
 * cspurl.link trust site — one hand-written stylesheet, served by nginx.
 *
 * Not a Vite build, on purpose: the redirect service ships no front-end
 * pipeline of its own, and six pages plus three error states do not need one.
 * Cache-busted with ?v={APP_VERSION} in the layout.
 *
 * One theme, deliberately. All three supplied logos carry dark lettering
 * (the "CSP" of CSP Geeks, "MAGE" of Mage URL, the Press Mage wordmark), so
 * they sit on light surfaces only; navy is used for the hero and footer,
 * which carry text and no logos. A dark-mode variant would put the logos on
 * navy and erase them.
 */

:root {
    --navy-900: #0b1b33;
    --navy-800: #12284a;
    --navy-700: #1b3762;
    --teal-300: #5eead4;
    --teal-400: #2dd4bf;
    --teal-700: #0f766e;
    --ink: #0f172a;
    --muted: #475569;
    --on-navy: #e2e8f0;
    --on-navy-muted: #cbd5e1;
    --surface: #ffffff;
    --surface-alt: #f4f6fa;
    --border: #dbe2ec;
    --danger-bg: #fef2f2;
    --danger-ink: #991b1b;
    --danger-border: #fecaca;
    --ok-bg: #ecfdf5;
    --ok-ink: #065f46;
    --ok-border: #a7f3d0;
    --focus: #0284c7;
    --radius: 12px;
    --wrap: 72rem;
    color-scheme: light;
}

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

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

body {
    margin: 0;
    font: 17px/1.65 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--ink);
    background: var(--surface);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main { flex: 1 0 auto; }

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

a { color: var(--teal-700); text-underline-offset: 3px; }
a:hover { color: var(--navy-700); }

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

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; margin: 0 0 .6em; }
h1 { font-size: clamp(2rem, 5.5vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }

.wrap {
    width: 100%;
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 640px) {
    .wrap { padding: 0 1.5rem; }
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--navy-900);
    color: #fff;
    padding: .6rem 1rem;
    z-index: 10;
}
.skip-link:focus { left: 1rem; top: 1rem; color: #fff; }

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

/* ---------------------------------------------------------------- header */

.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.site-header .wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .5rem 1.5rem;
    padding-top: .65rem;
    padding-bottom: .65rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: .7rem;
    color: var(--ink);
    text-decoration: none;
}
.brand img { width: 52px; height: 48px; }
.brand-name { font-weight: 800; font-size: 1.2rem; letter-spacing: -0.01em; line-height: 1.1; }
.brand-sub { display: block; font-size: .78rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }

.site-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: .25rem 1.1rem;
}
.site-nav a {
    color: var(--ink);
    text-decoration: none;
    font-weight: 600;
    font-size: .95rem;
    padding: .35rem 0;
    display: inline-block;
    border-bottom: 2px solid transparent;
}
.site-nav a:hover { border-bottom-color: var(--teal-400); color: var(--ink); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--teal-700); }

/* ------------------------------------------------------------------ hero */

.hero {
    background: var(--navy-900);
    background-image: linear-gradient(160deg, var(--navy-900) 0%, var(--navy-800) 60%, var(--navy-700) 100%);
    color: var(--on-navy);
    padding: 3.5rem 0 3.75rem;
}
.hero h1 { color: #fff; max-width: 18ch; }
.hero p { color: var(--on-navy-muted); max-width: 46rem; font-size: 1.1rem; }

.eyebrow {
    display: inline-block;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--teal-300);
    margin: 0 0 1rem;
}

.page-hero { padding: 2.75rem 0 2.5rem; }
.page-hero h1 { font-size: clamp(1.9rem, 4.5vw, 2.6rem); max-width: none; }

.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }

.button {
    display: inline-block;
    padding: .75rem 1.25rem;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    border: 2px solid transparent;
    cursor: pointer;
    line-height: 1.3;
}
.button-primary { background: var(--teal-400); color: var(--navy-900); }
.button-primary:hover { background: var(--teal-300); color: var(--navy-900); }
.button-ghost { border-color: var(--on-navy-muted); color: #fff; }
.button-ghost:hover { border-color: #fff; color: #fff; }
.button-dark { background: var(--navy-800); color: #fff; font: inherit; font-weight: 700; }
.button-dark:hover { background: var(--navy-700); color: #fff; }
.button-outline { border-color: var(--navy-800); color: var(--navy-800); }
.button-outline:hover { background: var(--surface-alt); color: var(--navy-900); }

/* ------------------------------------------------------------- sections */

.band { padding: 3.25rem 0; }
.band-alt { background: var(--surface-alt); }
.band > .wrap > p, .lead { max-width: 46rem; color: var(--muted); font-size: 1.05rem; }
.spaced { margin-top: 1.5rem; }

.grid {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: 1fr;
    margin-top: 1.5rem;
}
@media (min-width: 760px) {
    .grid-3 { grid-template-columns: repeat(3, 1fr); }
    .grid-2 { grid-template-columns: repeat(2, 1fr); }
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.4rem;
}
.card h3 { margin-bottom: .4rem; }
.card p:last-child { margin-bottom: 0; }
.card p { color: var(--muted); }

.role {
    display: block;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--teal-700);
    margin-bottom: .5rem;
}

.logo-card { display: flex; flex-direction: column; }
.logo-card .logo {
    height: 7rem;
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}
/* The flex child is the <picture>, not the <img>: both have to be bounded,
   or the image renders at its intrinsic size and spills out of the card. */
.logo-card .logo picture { display: block; height: 100%; max-width: 100%; }
.logo-card .logo img { height: 100%; width: auto; max-width: 100%; object-fit: contain; object-position: left center; }

.chain {
    list-style: none;
    margin: 1.5rem 0 0;
    padding: 0;
    display: grid;
    gap: .75rem;
    counter-reset: chain;
}
.chain li {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--teal-400);
    border-radius: 10px;
    padding: 1rem 1.2rem;
}
.chain strong { display: block; }

.callout {
    background: var(--navy-900);
    color: var(--on-navy);
    border-radius: var(--radius);
    padding: 1.6rem;
}
.callout h2, .callout h3 { color: #fff; }
.callout p { color: var(--on-navy-muted); }
.callout a:not(.button) { color: var(--teal-300); }

/* ----------------------------------------------------------- long-form */

.prose { max-width: 46rem; }
.prose h2 { font-size: 1.4rem; margin-top: 2.2rem; }
.prose h3 { margin-top: 1.5rem; }
.prose ul { padding-left: 1.25rem; margin: 0 0 1em; }
.prose li { margin: .3rem 0; }
.prose p, .prose li { color: #1e293b; }
.updated { color: var(--muted); font-size: .95rem; }

/* ----------------------------------------------------------------- forms */

.form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    max-width: 40rem;
}

.field { margin-top: 1.15rem; }
.field:first-of-type { margin-top: 0; }
label, .label { display: block; font-weight: 700; margin-bottom: .35rem; }
.optional { font-weight: 500; color: var(--muted); }
.hint { color: var(--muted); font-size: .9rem; margin: .35rem 0 0; }

input[type=text], input[type=email], input[type=url], select, textarea {
    width: 100%;
    padding: .65rem .75rem;
    border: 1px solid #94a3b8;
    border-radius: 8px;
    font: inherit;
    color: inherit;
    background: #fff;
}
textarea { min-height: 8rem; resize: vertical; }
[aria-invalid="true"] { border-color: var(--danger-ink); border-width: 2px; }
.field-error { color: var(--danger-ink); font-weight: 600; font-size: .92rem; margin: .35rem 0 0; }

.notice, .error-summary {
    padding: 1rem 1.1rem;
    border-radius: 10px;
    margin-bottom: 1.25rem;
    border: 1px solid;
}
.notice { background: var(--ok-bg); color: var(--ok-ink); border-color: var(--ok-border); }
.error-summary { background: var(--danger-bg); color: var(--danger-ink); border-color: var(--danger-border); }
.error-summary h2 { font-size: 1.05rem; margin: 0 0 .4rem; }
.error-summary ul { margin: 0; padding-left: 1.2rem; }
.error-summary a { color: var(--danger-ink); }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.reference {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .95rem;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: .15rem .45rem;
    word-break: break-all;
}

/* ---------------------------------------------------------- error pages */

.status-page { padding: 3.5rem 0 4rem; }
.status-page .card { max-width: 40rem; padding: 2rem; }
.status-code {
    font-size: .8rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: .75rem;
}

/* ---------------------------------------------------------------- footer */

.site-footer {
    background: var(--navy-900);
    color: var(--on-navy-muted);
    padding: 2.5rem 0 2rem;
    font-size: .95rem;
}
.site-footer a { color: var(--teal-300); }
.site-footer a:hover { color: #fff; }
.footer-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1fr;
}
@media (min-width: 760px) {
    .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
}
.site-footer h2 {
    font-size: .8rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #fff;
    margin-bottom: .7rem;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: .3rem 0; }
.disclosure { color: var(--on-navy); max-width: 34rem; }
.copyright {
    border-top: 1px solid var(--navy-700);
    margin-top: 2rem;
    padding-top: 1.25rem;
    font-size: .88rem;
}

@media (prefers-reduced-motion: no-preference) {
    a, .button { transition: color .15s, background-color .15s, border-color .15s; }
}
