/* Factsogy page chrome: sticky masthead, section primitives, buttons, footer. Requires base.css. */

/* ---------- Masthead (sticky) ---------- */

.masthead {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

/* Anchor jumps land below the sticky header */
[id] {
    scroll-margin-top: 92px;
}

/* ---------- Sections ---------- */

.section {
    padding: clamp(72px, 10vw, 128px) 0;
    border-bottom: 1px solid var(--line);
}

.section--alt {
    background: var(--surface);
}

.section-head {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: 24px clamp(32px, 6vw, 96px);
    align-items: end;
    margin-bottom: clamp(40px, 6vw, 64px);
}

.section-head h1,
.section-head h2 {
    font-size: clamp(44px, 7vw, 88px);
    margin: 0;
}

.section-head > p {
    margin: 0;
    color: var(--muted);
    font-size: 19px;
}

.section-head p strong {
    color: var(--text);
}

@media (max-width: 960px) {
    .section-head {
        grid-template-columns: 1fr;
    }
}

.masthead .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 76px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

/*
 * Logo is a square JPEG on white. The hexagon clip cuts away the corners on any
 * background; invert turns it into a white badge for the dark theme.
 */
.brand img {
    width: 52px;
    height: 52px;
    filter: invert(1);
    clip-path: polygon(50% 2%, 95% 26%, 95% 74%, 50% 98%, 5% 74%, 5% 26%);
}

.brand span {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 26px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.nav {
    display: flex;
    align-items: center;
    gap: clamp(14px, 3vw, 32px);
    font-family: var(--font-mono);
    font-size: 13px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.nav a {
    text-decoration: none;
    padding: 6px 0;
    border-bottom: 2px solid transparent;
}

.nav a:hover,
.nav a[aria-current="page"] {
    color: inherit;
    border-bottom-color: var(--accent);
}

@media (prefers-color-scheme: light) {
    .masthead:not(.masthead--overlay) .brand img,
    .site-footer .brand img {
        filter: none;
    }
}

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 22px;
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    border: 2px solid currentColor;
    border-radius: var(--radius);
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s var(--ease-out);
}

.btn:hover {
    transform: translateY(-2px);
}

.btn--primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
}

.btn--primary:hover {
    color: var(--accent-ink);
    background: #e22a1f;
}

.btn--small {
    min-height: 44px;
    padding: 0 16px;
    font-size: 12px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
}

.btn--small:hover {
    background: var(--text);
    color: var(--bg);
}

/* ---------- Footer ---------- */

.site-footer {
    border-top: 1px solid var(--line);
    background: var(--surface);
    padding: 48px 0 40px;
    font-size: 15px;
    color: var(--muted);
}

.site-footer .wrap {
    display: grid;
    gap: 28px;
    grid-template-columns: 1fr auto;
    align-items: center;
}

.site-footer .brand span {
    color: var(--text);
    font-size: 22px;
}

.site-footer .brand img {
    width: 40px;
    height: 40px;
}

.site-footer p {
    margin: 8px 0 0;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 28px;
    font-family: var(--font-mono);
    font-size: 13px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

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

.footer-social {
    display: flex;
    gap: 10px;
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
}

.footer-social a {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--text);
    transition: border-color 0.2s ease, color 0.2s ease;
}

.footer-social a:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.footer-social svg {
    width: 20px;
    height: 20px;
}

/* ---------- Responsive ---------- */

@media (max-width: 640px) {
    .nav .nav-section {
        display: none;
    }

    .brand span {
        font-size: 22px;
    }

    .brand img {
        width: 44px;
        height: 44px;
    }

    .site-footer .wrap {
        grid-template-columns: 1fr;
    }
}
