/* Snag - shared by index, privacy and terms.
 *
 * These rules were copied into all three pages, which is how privacy and terms
 * came to differ from index without anyone deciding they should. One copy now:
 * a change here reaches every page. */

:root {
    /* Tells the browser both themes are handled, so it stops applying its own
       forced-dark filter -- which mangles a page that has real dark styles. */
    color-scheme: light dark;

    --brand-dark: #1A1A2E;
    --brand: #16213E;
    --accent: #AA7FF3;
    --bg: #F4F5FA;
    --surface: #FFFFFF;
    --text-primary: #1A1A2E;   /* app textPrimary (light) */
    --text-secondary: #5E6478; /* app textSecondary (light) */
    --divider: #E9EBF3;       /* app surface (light) */

    /* Header and footer keep the dark brand ground in both themes, so their
       text does not swap. */
    /* The accent is a *ground* colour. The app's own #7C3AED measures 2.99 as
       link text on the dark page and 2.63 on a card -- both fail AA -- so text
       never uses it raw. This is the darkened version, for a light ground:
       6.53 on --bg, 7.10 on --surface. */
    --accent-text: #6D28D9;

    /* Text that sits ON the accent. Dark here because this accent is light:
       #1A1A2E on #AA7FF3 is 5.72, where white would be 2.42 and fail. An app
       with a dark accent defines this light instead; nothing else changes.
       Named for the job, so it is not a ground token doing a text token's
       work. */
    --on-accent: #1A1A2E;

    --on-brand: rgba(255,255,255,0.85);
    --on-brand-strong: #FFFFFF;
    --footer-text: rgba(255,255,255,0.7);
}

/* Dark, lifted from the app's own palette in lib/app/theme.dart so the site
   and the product look like the same thing. Only tokens are redefined; every
   rule below styles through them. */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #1A1A2E;            /* darkBackground */
        --surface: #1F2940;       /* darkSurface */
        --text-primary: #FFFFFF;  /* app textPrimary (dark) */
        --text-secondary: #B0B0B0;/* app textSecondary (dark) */
        --divider: #16213E;       /* app surface (dark) */
        /* --brand is the app's darkSurface and is only ever a gradient stop
           under white text: white is 15.89 on it, and the hero subtitle at 80%
           is 10.59. */

        /* On a dark ground the lightened accent is 5.19 on the page and 4.86 on
           a card, so text uses it directly. */
        --accent-text: var(--accent);
    }
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-primary);
    background: var(--bg);
    line-height: 1.6;
}

a { color: inherit; text-decoration: none; }

/* Keyboard users could not see where they were: privacy and terms had no focus
   styling at all, and index only had :focus-within for pausing the marquee.
   :focus-visible so it appears for keyboards and not for mouse clicks. */
/* The ring follows the ground it lands on. --accent is tuned to read on the
   dark brand, where it is 5.72; on the light page it is 2.74 and misses the
   3:1 that a non-text indicator has to reach. --accent-text is the light-ground
   variant and already flips to --accent in dark mode, so one rule covers both
   themes -- and the three surfaces that stay dark in either get the bright one
   back. */
:focus-visible {
    outline: 3px solid var(--accent-text);
    outline-offset: 3px;
    border-radius: 4px;
}

.header :focus-visible,
.footer :focus-visible,
.hero :focus-visible {
    outline-color: var(--accent);
}

/* The skip link's own ground is the accent, so the ring cannot be. */
.skip-link:focus-visible {
    outline-color: var(--on-accent);
}

/* Off-screen until focused, then the first stop on the page. */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 200;
    background: var(--accent);
    color: var(--brand-dark);
    font-weight: 700;
    padding: 12px 20px;
    border-radius: 0 0 8px 0;
}
.skip-link:focus {
    left: 0;
}

/* ── Header ── */
.header {
    background: linear-gradient(135deg, var(--brand-dark), var(--brand));
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-brand img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
}

.header-brand span {
    font-size: 20px;
    font-weight: 700;
    color: #FFFFFF;
}

.header-nav {
    display: flex;
    gap: 28px;
}

.header-nav a {
    color: var(--on-brand);
    font-size: 15px;
    font-weight: 500;
    transition: color 0.2s;
    /* The hit area was the text, ~20px tall. Padding brings it to 44px without
       moving anything, since the header centres its row. */
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 4px;
}

.header-nav a:hover,
.header-nav a.active {
    /* The lightened accent: this sits on the dark brand header, which does not flip. */
    color: var(--accent);
}

/* ── Footer ── */
.footer {
    background: var(--brand-dark);
    color: var(--footer-text);
    padding: 36px 24px;
}

.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-copy { font-size: 14px; }

.footer-nav {
    display: flex;
    gap: 24px;
}

.footer-nav a {
    font-size: 14px;
    transition: color 0.2s;
}

.footer-nav a:hover { color: var(--accent); }  /* on the dark brand ground */

/* ── Shared responsive ── */
@media (max-width: 520px) {
    .header-nav { gap: 16px; }
    .footer-inner { flex-direction: column; text-align: center; }
}
