/* Handshake Mirror — CSP compliant, no inline styles anywhere. */

:root {
    --hs-primary: #00b4d8;
    --hs-primary-dark: #0077b6;
    --hs-primary-light: #90e0ef;
    --hs-accent: #00ff88;
    --hs-warn: #ffaa00;
    --hs-danger: #ff4d4d;
    --hs-muted: #6b7280;
    --hs-bg: #0a0a0f;
    --hs-card: #12121a;
    --hs-card-hover: #1a1a25;
    --hs-text: #ffffff;
    --hs-text-dim: #a0a0b0;
    --hs-border: #2a2a3a;
    --hs-code-bg: #1a1a2e;
    --hs-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}

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

html, body {
    background: transparent;
    min-height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--hs-bg);
    color: var(--hs-text);
    line-height: 1.65;
    min-height: 100vh;
    overflow-x: hidden;
}

code, pre, .hs-value, .hs-absent {
    font-family: 'SFMono-Regular', ui-monospace, Menlo, Consolas, 'Liberation Mono', monospace;
}

/* ── Header ─────────────────────────────────────────────────────────── */

.hs-header {
    position: relative;
    z-index: 2;
    border-bottom: 1px solid var(--hs-border);
    background: rgba(10, 10, 15, 0.82);
    backdrop-filter: blur(10px);
}

.header-container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 1.75rem 1.25rem;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.logo-link {
    display: block;
    flex-shrink: 0;
}

.logo-image {
    width: 62px;
    height: 62px;
    border-radius: 12px;
    display: block;
}

.page-title {
    font-size: clamp(1.7rem, 4vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--hs-primary-light), var(--hs-accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.page-subtitle {
    color: var(--hs-text-dim);
    font-size: 0.98rem;
    margin-top: 0.2rem;
}

/* ── Layout ─────────────────────────────────────────────────────────── */

.hs-main {
    position: relative;
    z-index: 2;
    max-width: 1180px;
    margin: 0 auto;
    padding: 2.25rem 1.25rem 3rem;
}

/* ── Verdict banner ─────────────────────────────────────────────────── */

.hs-verdict {
    border: 1px solid var(--hs-border);
    border-left-width: 5px;
    border-radius: 14px;
    padding: 1.6rem 1.75rem;
    background: var(--hs-card);
    box-shadow: var(--hs-shadow);
    margin-bottom: 2.25rem;
}

.hs-verdict-post-quantum { border-left-color: var(--hs-accent); }
.hs-verdict-classical    { border-left-color: var(--hs-warn); }
.hs-verdict-unmeasured   { border-left-color: var(--hs-muted); }

.hs-verdict-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    margin-bottom: 0.65rem;
    border: 1px solid currentColor;
}

.hs-verdict-post-quantum .hs-verdict-badge { color: var(--hs-accent); }
.hs-verdict-classical .hs-verdict-badge    { color: var(--hs-warn); }
.hs-verdict-unmeasured .hs-verdict-badge   { color: var(--hs-muted); }

.hs-verdict-title {
    font-size: clamp(1.3rem, 3vw, 1.85rem);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.hs-verdict-detail {
    color: var(--hs-text-dim);
    max-width: 68ch;
}

/* ── Fact cards ─────────────────────────────────────────────────────── */

.hs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
    gap: 1.15rem;
    margin-bottom: 2.75rem;
}

.hs-card {
    background: var(--hs-card);
    border: 1px solid var(--hs-border);
    border-radius: 12px;
    padding: 1.35rem 1.45rem;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.hs-card:hover {
    border-color: var(--hs-primary-dark);
    transform: translateY(-2px);
}

.hs-card-title {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: var(--hs-primary);
    margin-bottom: 0.95rem;
}

.hs-dl {
    display: grid;
    grid-template-columns: minmax(6.5rem, auto) 1fr;
    gap: 0.45rem 1rem;
    margin-bottom: 0.9rem;
}

.hs-dl dt {
    color: var(--hs-text-dim);
    font-size: 0.87rem;
}

.hs-dl dd {
    font-size: 0.9rem;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.hs-value {
    color: var(--hs-accent);
}

.hs-link {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.hs-link:hover {
    color: var(--hs-primary-light);
}

.hs-flag-on {
    color: var(--hs-warn);
}

.hs-absent {
    color: var(--hs-muted);
    font-style: italic;
}

.hs-note {
    color: var(--hs-text-dim);
    font-size: 0.86rem;
    line-height: 1.6;
    margin-top: 0.7rem;
}

.hs-note-dim {
    color: var(--hs-muted);
    font-size: 0.8rem;
}

.hs-note a,
.hs-prose a,
.hs-footer a {
    color: var(--hs-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.hs-note a:hover,
.hs-prose a:hover,
.hs-footer a:hover {
    color: var(--hs-primary-light);
}

/* ── ECH status line ────────────────────────────────────────────────── */

.hs-ech {
    font-size: 1.05rem;
    font-weight: 600;
    padding: 0.55rem 0.85rem;
    border-radius: 8px;
    border: 1px solid var(--hs-border);
    background: rgba(0, 0, 0, 0.28);
}

.hs-ech-good  { color: var(--hs-accent); border-color: rgba(0, 255, 136, 0.35); }
.hs-ech-warn  { color: var(--hs-warn);   border-color: rgba(255, 170, 0, 0.35); }
.hs-ech-muted { color: var(--hs-muted); }

/* ── Code + button ──────────────────────────────────────────────────── */

.hs-code {
    background: var(--hs-code-bg);
    border: 1px solid var(--hs-border);
    border-radius: 8px;
    padding: 0.8rem 0.95rem;
    overflow-x: auto;
    font-size: 0.85rem;
    margin: 0.75rem 0;
}

.hs-code code {
    color: var(--hs-primary-light);
    white-space: pre;
}

.hs-prose code {
    background: var(--hs-code-bg);
    border: 1px solid var(--hs-border);
    border-radius: 5px;
    padding: 0.08rem 0.35rem;
    font-size: 0.87em;
    color: var(--hs-primary-light);
}

/*
 * Used on both <a> and <button>. The button cases are the reason `background`
 * and `font-family` are set explicitly: a <button> inherits neither, so the UA
 * stylesheet gave it the system font on a near-white `buttonface` background —
 * and light cyan text on near-white is what made "Re-check this connection" and
 * the Copy buttons unreadable. An <a> was transparent and looked fine, which is
 * why the two rendered completely differently from one rule.
 */
.hs-btn {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.5rem 1.05rem;
    border-radius: 8px;
    border: 1px solid var(--hs-primary-dark);
    background: rgba(0, 119, 182, 0.14);
    color: var(--hs-primary-light);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.hs-btn:hover,
.hs-btn:focus-visible {
    background: var(--hs-primary-dark);
    border-color: var(--hs-primary-light);
    color: #fff;
    outline: none;
}

.hs-btn:disabled {
    opacity: 0.55;
    cursor: default;
}

/* The copy buttons sit under a code block, so they need no top gap. */
.hs-copy {
    margin-top: 0.35rem;
    font-size: 0.8rem;
    padding: 0.35rem 0.85rem;
}

/* ── Prose ──────────────────────────────────────────────────────────── */

.hs-prose {
    max-width: 74ch;
    color: var(--hs-text-dim);
}

.hs-prose h2 {
    color: var(--hs-text);
    font-size: 1.35rem;
    font-weight: 700;
    margin: 2rem 0 0.75rem;
}

.hs-prose h2:first-child {
    margin-top: 0;
}

.hs-prose p {
    margin-bottom: 0.95rem;
}

.hs-prose strong {
    color: var(--hs-text);
}

/* ── Footer ─────────────────────────────────────────────────────────── */

.hs-footer {
    position: relative;
    z-index: 2;
    border-top: 1px solid var(--hs-border);
    padding: 1.5rem 1.25rem 2.5rem;
    text-align: center;
    color: var(--hs-text-dim);
    font-size: 0.87rem;
}

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

@media (max-width: 640px) {
    .hs-dl {
        grid-template-columns: 1fr;
        gap: 0.15rem;
    }

    .hs-dl dt {
        margin-top: 0.45rem;
    }

    .hs-verdict {
        padding: 1.2rem 1.1rem;
    }
}
