/* ═══════════════════════════════════════════════════════════════════════════
   theme.css — shared monochrome design tokens.

   Ships unchanged in typesec, infrasec, sigvolt, lolevel, gradflow, reflex and
   mathemphetamine. Keep it project-agnostic: anything specific to one app
   belongs in that app's style.css, which aliases its own names onto the tokens
   defined here.

   The rule: every colour is a shade of grey. Hierarchy comes from weight,
   size, spacing, border and opacity — never from hue.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
    color-scheme: light;

    /* ── Core tokens ──────────────────────────────────────────────────── */
    --bg: #ffffff;
    --bg-subtle: #f5f5f5;
    --bg-muted: #e8e8e8;
    --border: #d4d4d4;
    --text-primary: #111111;
    --text-secondary: #555555;
    --text-muted: #888888;

    /* ── Derived neutrals ─────────────────────────────────────────────── */
    /* Focus and emphasis raise contrast rather than introducing colour. */
    --border-strong: #a3a3a3;
    /* Text sitting on a --text-primary fill (the inverted primary button). */
    --text-inverse: #ffffff;
    /* Overlay fills for chips, highlights and selections that would
       otherwise be tinted. Three steps of emphasis, no hue. */
    --fill-weak: rgba(17, 17, 17, 0.04);
    --fill: rgba(17, 17, 17, 0.08);
    --fill-strong: rgba(17, 17, 17, 0.14);
    /* Elevation is carried by --border; these stay deliberately near-invisible. */
    --shadow-sm: 0 1px 2px rgba(17, 17, 17, 0.05);
    --shadow-md: 0 2px 8px rgba(17, 17, 17, 0.06);
    --shadow-lg: 0 8px 28px rgba(17, 17, 17, 0.08);

    /* ── Type ─────────────────────────────────────────────────────────── */
    /* Inter matches the hub (mohamedzaam.com) and its sibling sites, so the
       "<project> by Mohamed Zaam" lockup renders identically everywhere. It is
       loaded from Google Fonts in each index.html; the system stack behind it
       carries the page if that request fails. */
    --sans:
        "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
        Ubuntu, Cantarell, sans-serif;
    --mono:
        ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas,
        "Liberation Mono", monospace;

    /* ── Shape ────────────────────────────────────────────────────────── */
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 5px;
}

:root[data-theme="dark"] {
    color-scheme: dark;

    --bg: #0d0d0d;
    --bg-subtle: #161616;
    --bg-muted: #212121;
    --border: #2e2e2e;
    --text-primary: #f2f2f2;
    --text-secondary: #b0b0b0;
    --text-muted: #7a7a7a;

    --border-strong: #4d4d4d;
    --text-inverse: #0d0d0d;
    --fill-weak: rgba(242, 242, 242, 0.05);
    --fill: rgba(242, 242, 242, 0.09);
    --fill-strong: rgba(242, 242, 242, 0.15);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.55);
    --shadow-lg: 0 8px 28px rgba(0, 0, 0, 0.6);
}

/* ── Site lockup ────────────────────────────────────────────────────────────
   "<project> by / Mohamed Zaam / systems · security · solutions" — the same
   lockup the hub uses, so all the sites read as one family.

   Every value here is copied verbatim from hub/css/styles.css. That includes
   the fixed #9ca3af on the "by" and the tagline: it is deliberately *not*
   themed, so the line looks the same in light mode, dark mode, and on
   mohamedzaam.com / docs. / blog. Keep this block in sync with the hub rather
   than with the grey ramp above — it is the one intentional exception to the
   monochrome rule. */

.hero-lockup {
    text-align: center;
}

.hero-title-row {
    display: inline-flex;
    align-items: baseline;
    gap: 0.625rem;
    margin-bottom: 0.25rem;
}

/* the hub styles this as a bare h1; scoped to a class here so it cannot
   collide with the h1 rules the individual apps already carry */
.hero-title {
    font-size: clamp(3rem, 7vw, 6rem);
    font-weight: 300;
    letter-spacing: -0.04em;
    line-height: 1;
    margin: 0;
}

.hero-by {
    font-size: clamp(1.25rem, 3vw, 2rem);
    color: #9ca3af;
    font-weight: 400;
    /* several apps set a line-height on body; the hub does not, so pin it */
    line-height: normal;
}

.name-link {
    display: block;
    text-decoration: none;
    color: var(--text-primary);
    font-size: clamp(1.25rem, 2.5vw, 1.5rem);
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: normal;
    margin-bottom: 0.25rem;
    transition: color 0.2s ease;
}

.name-link:visited {
    color: var(--text-primary);
}

@media (hover: hover) {
    .name-link:hover {
        color: var(--text-muted);
    }
}

/* Single source of truth for "systems · security · solutions" — same font,
   colour and size as in the hub header and every sibling footer. */
.lead,
p.lead,
a.lead {
    display: block;
    margin: 0.25rem 0 0;
    font-family: inherit;
    font-size: 0.75rem;
    line-height: 1rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    color: #9ca3af;
    text-align: center;
    text-decoration: none;
}

a.lead:visited {
    color: #9ca3af;
}

@media (hover: hover) {
    a.lead:hover {
        color: #9ca3af;
    }
}

/* ── Theme toggle ───────────────────────────────────────────────────────────
   Injected by theme.js, so no project needs markup of its own. Pinned to the
   top-right; every app's own fixed layer is a pointer-events:none flash
   overlay, so nothing collides. */

.theme-toggle {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition:
        color 0.15s ease,
        border-color 0.15s ease,
        background 0.15s ease;
}

.theme-toggle:hover {
    background: var(--bg-muted);
    border-color: var(--border-strong);
    color: var(--text-primary);
}

.theme-toggle:focus-visible {
    outline: none;
    border-color: var(--text-primary);
    box-shadow: 0 0 0 2px var(--fill-strong);
}

.theme-toggle svg {
    display: block;
    width: 17px;
    height: 17px;
    /* Line icons, single colour, inherited from the button. */
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Show the mode you would switch *to*: a moon while light, a sun while dark. */
.theme-toggle .theme-icon-sun {
    display: none;
}
:root[data-theme="dark"] .theme-toggle .theme-icon-sun {
    display: block;
}
:root[data-theme="dark"] .theme-toggle .theme-icon-moon {
    display: none;
}

@media (prefers-reduced-motion: reduce) {
    .theme-toggle {
        transition: none;
    }
}
