/*
 * Public site styles (landing, privacy, terms).
 *
 * Consumes the SAME generated custom properties as the SPA — public/css/tokens.css,
 * generated from resources/design/tokens.json. No colour, size, or radius is
 * written literally here; a raw hex in this file is a test failure.
 *
 * These pages are deliberately JS-free apart from the pre-paint theme script.
 *
 * Lives in public/ rather than resources/ on purpose: it is plain CSS with no
 * preprocessing, so routing it through a Vite build would add a pipeline for a
 * single file. It sits beside the generated tokens.css it consumes.
 */

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

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

body {
    margin: 0;
    background: var(--surface-0);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.wrap {
    max-width: 68rem;
    margin: 0 auto;
    padding: 0 var(--space-5);
}

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

.site-header .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    min-height: 4rem;
}

/* The nav holds the theme control and Sign in; a flex row keeps them vertically
   centred against each other regardless of their differing heights. */
.site-header nav {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.brand {
    font-weight: 600;
    font-size: var(--text-lg);
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.01em;
}

.brand .mark { color: var(--accent); }

/* Two-state light/dark control. The active side reflects the theme on screen;
   auto is the default until a choice is saved, not a visible button. */
.theme-switch {
    display: inline-flex;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.theme-switch__opt {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* 44px touch target below md (ARCHITECTURE §14.2). */
    min-height: 44px;
    min-width: 40px;
    padding: 0 var(--space-2);
    background: transparent;
    border: none;
    border-left: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
}

.theme-switch__opt:first-child { border-left: none; }

.theme-switch__opt:hover { color: var(--text-primary); }

.theme-switch__opt.is-active {
    background: var(--surface-2);
    color: var(--primary);
}

.theme-switch__opt svg { display: block; }

/* --- Hero --- */
.hero { padding: var(--space-6) 0; }

.hero h1 {
    font-size: var(--text-2xl);
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin: 0 0 var(--space-4);
    max-width: 34ch;
}

.hero p.lead {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    margin: 0 0 var(--space-5);
    max-width: 62ch;
}

/* --- Cards --- */
.card {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
}

.card h2 { font-size: var(--text-lg); margin: 0 0 var(--space-3); }

.muted { color: var(--text-muted); font-size: var(--text-sm); }

/* Reference numbers and quoted evidence use the mono face — unambiguous
   0/O and 1/l matter when reading an ECA number. */
.ref { font-family: var(--font-mono); font-size: var(--text-sm); }

/* --- Score bands: a single-hue INTENSITY ramp. Never a traffic light, and
   never hue alone — the label is always present. --- */
.band {
    display: inline-block;
    padding: 0.1rem var(--space-2);
    border-radius: var(--radius);
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.band-low { background: var(--band-low); color: var(--text-primary); }
.band-medium { background: var(--band-medium); color: var(--surface-1); }
.band-high { background: var(--band-high); color: var(--surface-1); }

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius);
    background: var(--primary);
    color: var(--surface-1);
    text-decoration: none;
    font-weight: 600;
    border: 1px solid var(--primary);
}

.btn:hover { filter: brightness(1.08); }

.btn-secondary {
    background: transparent;
    color: var(--primary);
}

/* --- Prose (legal pages) --- */
.prose { max-width: 72ch; padding: var(--space-6) 0; }
.prose h1 { font-size: var(--text-xl); margin-bottom: var(--space-2); }
.prose h2 { font-size: var(--text-lg); margin-top: var(--space-6); }
.prose a { color: var(--primary); }

.review-flag {
    border-left: 3px solid var(--warning);
    background: var(--surface-2);
    padding: var(--space-3) var(--space-4);
    margin: var(--space-4) 0;
    font-size: var(--text-sm);
}

/* --- Footer --- */
.site-footer {
    border-top: 1px solid var(--border);
    margin-top: var(--space-6);
    padding: var(--space-5) 0;
    color: var(--text-muted);
    font-size: var(--text-sm);
}

.site-footer .wrap {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    justify-content: space-between;
}

.site-footer a { color: var(--text-secondary); }

@media (max-width: 40rem) {
    .hero h1 { font-size: var(--text-xl); }
}
