/* ═══════════════════════════════════════════════════════════════════════
   Homepage v5 — Quiet Editorial
   Loaded only by index.php. All classes prefixed hx- to avoid collisions
   with shared stylesheets. Theme-aware via design-system.css tokens.
   ═══════════════════════════════════════════════════════════════════════ */

/* Background goes on body only: theme tokens are scoped to body[data-theme],
   and an unpainted html lets body's background fill the whole canvas,
   including the overscroll area past the footer. */
html,
body {
    margin: 0;
    padding: 0;
}

body {
    background: var(--site-bg);
    color: var(--site-text);
}

.hx-container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 1.5rem;
    box-sizing: border-box;
}

@keyframes hxFadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Hero ──────────────────────────────────────────────────────────── */

.hx-hero {
    padding: clamp(5rem, 12vh, 9rem) 0 clamp(4rem, 10vh, 7rem);
}

.hx-hero > .hx-container > * {
    opacity: 0;
    animation: hxFadeUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.hx-eyebrow {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0 0 2rem;
    font-family: 'DM Mono', monospace;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--site-text-muted);
}

.hx-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

.hx-title {
    margin: 0 0 1.5rem;
    font-family: 'DM Serif Display', Georgia, serif;
    font-weight: 400;
    font-size: clamp(2.8rem, 7vw, 5rem);
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--site-text-strong);
}

.hx-title-em {
    display: block;
    font-style: italic;
    color: var(--site-text-muted);
}

.hx-subhead {
    margin: 0 0 2.5rem;
    max-width: 460px;
    font-family: 'DM Sans', sans-serif;
    font-size: 1.0625rem;
    line-height: 1.7;
    color: var(--site-text-muted);
}

.hx-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.hx-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    border-radius: 999px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.hx-btn--primary {
    background: var(--site-text-strong);
    color: var(--site-bg);
}

.hx-btn--primary:hover {
    background: var(--site-accent);
    color: #fff;
    transform: translateY(-1px);
}

.hx-btn-arrow {
    transition: transform 0.2s ease;
}

.hx-btn--primary:hover .hx-btn-arrow {
    transform: translateX(3px);
}

.hx-btn--ghost {
    border: 1px solid var(--site-border);
    color: var(--site-text);
}

.hx-btn--ghost:hover {
    border-color: var(--site-text-muted);
    transform: translateY(-1px);
}

.hx-btn:active {
    transform: scale(0.98);
}

/* ── Topic index ───────────────────────────────────────────────────── */

.hx-topics {
    padding: 0 0 clamp(5rem, 12vh, 8rem);
}

.hx-topics-head {
    margin-bottom: 2.5rem;
}

.hx-kicker {
    margin: 0 0 0.6rem;
    font-family: 'DM Mono', monospace;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--site-accent);
}

.hx-topics-title {
    margin: 0;
    font-family: 'DM Serif Display', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1.6rem, 3.2vw, 2.2rem);
    letter-spacing: -0.01em;
    color: var(--site-text-strong);
}

/* Hairline-divided grid: 1px gaps over a border-colored backdrop */
.hx-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--site-border);
    border: 1px solid var(--site-border);
    border-radius: 16px;
    overflow: hidden;
}

.hx-card {
    position: relative;
    display: block;
    padding: 2rem 1.75rem 2.25rem;
    background: var(--site-bg);
    text-decoration: none;
    transition: background 0.25s ease;
}

.hx-card:hover,
.hx-card:focus-visible {
    background: var(--site-bg-alt);
    outline: none;
}

.hx-card-num {
    display: block;
    margin-bottom: 2.25rem;
    font-family: 'DM Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    color: var(--site-text-muted);
    transition: color 0.25s ease;
}

.hx-card:hover .hx-card-num {
    color: var(--site-accent);
}

.hx-card-title {
    margin: 0 0 0.5rem;
    font-family: 'DM Sans', sans-serif;
    font-size: 1.0625rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--site-text-strong);
}

.hx-card-copy {
    margin: 0;
    padding-right: 1.5rem;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--site-text-muted);
}

.hx-card-arrow {
    position: absolute;
    right: 1.5rem;
    bottom: 1.75rem;
    font-size: 1rem;
    color: var(--site-accent);
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.hx-card:hover .hx-card-arrow,
.hx-card:focus-visible .hx-card-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* ── Responsive ────────────────────────────────────────────────────── */

@media (max-width: 900px) {
    .hx-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 560px) {
    .hx-grid {
        grid-template-columns: 1fr;
    }

    .hx-card {
        padding: 1.5rem 1.25rem 1.75rem;
    }

    .hx-card-num {
        margin-bottom: 1.25rem;
    }
}

/* ── Reduced motion ────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    .hx-hero > .hx-container > * {
        animation: none;
        opacity: 1;
    }

    .hx-btn,
    .hx-card,
    .hx-card-arrow,
    .hx-btn-arrow {
        transition: none;
    }
}
