/* ═══════════════════════════════════════════════════════
   Hacker House Badge — standalone styles
   Accent: --hackerday (rose family, retinted per theme)
   ═══════════════════════════════════════════════════════ */

:root {
    --hackerday: #fb7185;
    --hackerday-rgb: 251, 113, 133;
    --hackerday-dim: rgba(var(--hackerday-rgb), 0.12);
}

/* ──────────────────────────────────────────────────────
   HERO — portrait board on the left, copy on the right
   ────────────────────────────────────────────────────── */
.hd-hero {
    display: grid;
    grid-template-columns: 0.85fr 1.15fr;
    gap: 56px;
    align-items: center;
    padding: 72px 0 56px;
    min-height: calc(100dvh - 120px);
}

.hd-hero-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

.hd-board-gallery {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
}

/* The badge is 77.6 × 116.3 mm — portrait, so it is height-capped
   rather than width-capped like the round boards. */
.hd-board-img {
    position: relative;
    width: auto;
    max-width: 100%;
    max-height: min(62vh, 520px);
    height: auto;
    display: block;
    filter: invert(var(--art-invert));
}

.hd-board-thumbs {
    display: flex;
    gap: 10px;
}

.hd-thumb {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.hd-thumb img {
    width: 28px;
    height: 42px;
    object-fit: contain;
    opacity: 0.6;
    filter: invert(var(--art-invert));
    transition: opacity 0.15s;
}

.hd-thumb.is-active,
.hd-thumb:hover {
    border-color: var(--hackerday);
    background: var(--hackerday-dim);
    color: var(--hackerday);
}

.hd-thumb.is-active img,
.hd-thumb:hover img {
    opacity: 1;
}

/* ── Hero copy ── */
.hd-hero-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.hd-hero-title {
    font-size: clamp(2.8rem, 6.4vw, 5.4rem);
    font-weight: 600;
    line-height: 0.94;
    letter-spacing: -0.04em;
    color: var(--text);
    margin: 14px 0 20px;
}

.hd-title-badge {
    color: var(--hackerday);
    display: block;
}

.hd-hero-lead {
    font-size: clamp(1.1rem, 2.2vw, 1.5rem);
    font-weight: 500;
    line-height: 1.35;
    color: var(--text);
    margin: 0 0 14px;
}

.hd-hero-desc {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--muted);
    margin: 0 0 24px;
    max-width: 480px;
}

.hd-hero-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    margin-bottom: 24px;
}

.hd-meta-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.hd-meta-key {
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    color: var(--muted);
    text-transform: uppercase;
    min-width: 96px;
}

.hd-meta-val {
    font-size: 0.82rem;
    color: var(--text);
}

.hd-hero-buttons {
    gap: 10px;
}

/* ──────────────────────────────────────────────────────
   Shared-component accent overrides
   ────────────────────────────────────────────────────── */
.hd-stat-strip .e32-stat-value,
.hd-chip-card .e32-chip-name,
.hd-secure-card .e32-secure-glyph,
.hd-peripheral-card .e32-peripheral-num {
    color: var(--hackerday);
}

.hd-secure-card .e32-secure-dot {
    background: var(--hackerday);
}

/* ──────────────────────────────────────────────────────
   DISPLAY CARD — 2.8" TFT panel mock
   ────────────────────────────────────────────────────── */
.hd-display-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
}

.hd-display-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--line);
    background: rgba(var(--fg-rgb), 0.02);
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    color: var(--muted);
    font-weight: 600;
}

.hd-display-header span:last-child {
    color: var(--hackerday);
}

.hd-display-body {
    padding: 22px 20px;
}

/* Panel proportions mirror the real 320×240 landscape module */
.hd-panel {
    aspect-ratio: 4 / 3;
    border: 1px solid var(--line-strong);
    border-radius: 4px;
    background: var(--surface);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 18px;
}

.hd-panel-res {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.02em;
}

.hd-panel-note {
    font-size: 0.66rem;
    letter-spacing: 0.1em;
    color: var(--muted);
}

.hd-display-specs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 16px;
}

.hd-display-spec {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.72rem;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--line);
}

.hd-display-spec span:first-child { color: var(--muted); }
.hd-display-spec span:last-child  { color: var(--text); }

/* ──────────────────────────────────────────────────────
   CONTROL PAD — D-pad + action diamond
   ────────────────────────────────────────────────────── */
.hd-pad-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 28px 24px 24px;
}

.hd-pad-title {
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    color: var(--muted);
    font-weight: 600;
    text-align: center;
    margin-bottom: 24px;
}

.hd-pad-row {
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 24px;
    flex-wrap: wrap;
}

/* Each cluster is a 3×3 grid with the buttons on the diamond points */
.hd-pad {
    display: grid;
    grid-template-columns: repeat(3, 44px);
    grid-template-rows: repeat(3, 44px);
    gap: 4px;
}

.hd-key {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    background: var(--surface);
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--text);
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.hd-key:hover {
    border-color: var(--hackerday);
    background: var(--hackerday-dim);
    color: var(--hackerday);
}

.hd-key--up    { grid-area: 1 / 2; }
.hd-key--left  { grid-area: 2 / 1; }
.hd-key--right { grid-area: 2 / 3; }
.hd-key--down  { grid-area: 3 / 2; }

.hd-key-pin {
    display: block;
    font-size: 0.52rem;
    color: var(--muted);
    letter-spacing: 0.06em;
}

.hd-key:hover .hd-key-pin { color: var(--hackerday); }

.hd-pad-caption {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    font-size: 0.72rem;
    line-height: 1.6;
    color: var(--muted);
    text-align: center;
}

.hd-pad-caption strong {
    color: var(--hackerday);
    font-weight: 600;
}

/* ──────────────────────────────────────────────────────
   I²C BUS MAP
   ────────────────────────────────────────────────────── */
.hd-bus-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
}

.hd-bus-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--line);
    background: rgba(var(--fg-rgb), 0.02);
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    font-weight: 600;
    color: var(--hackerday);
}

.hd-bus-header span:last-child {
    color: var(--muted);
    letter-spacing: 0.06em;
    font-weight: 400;
}

.hd-bus-row {
    display: grid;
    grid-template-columns: 72px 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 12px 18px;
    border-bottom: 1px solid var(--line);
    font-size: 0.76rem;
}

.hd-bus-row:last-child { border-bottom: none; }

.hd-bus-addr {
    color: var(--hackerday);
    font-weight: 600;
}

.hd-bus-name  { color: var(--text); }
.hd-bus-role  { color: var(--muted); font-size: 0.68rem; text-align: right; }

/* ──────────────────────────────────────────────────────
   USB MODE SWITCH
   ────────────────────────────────────────────────────── */
.hd-switch-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
}

.hd-switch-header {
    padding: 12px 18px;
    border-bottom: 1px solid var(--line);
    background: rgba(var(--fg-rgb), 0.02);
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    color: var(--muted);
    font-weight: 600;
}

.hd-switch-body {
    padding: 22px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.hd-switch-port {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    background: var(--hackerday-dim);
    border: 1px solid rgba(var(--hackerday-rgb), 0.3);
    border-radius: 6px;
    padding: 6px 18px;
}

.hd-switch-arrow {
    font-size: 1.2rem;
    color: var(--hackerday);
    opacity: 0.6;
}

.hd-switch-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
}

.hd-switch-path {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 14px 10px;
    border-radius: 6px;
    border: 1px solid var(--line);
    text-align: center;
}

.hd-switch-path--a {
    background: var(--hackerday-dim);
    border-color: rgba(var(--hackerday-rgb), 0.25);
}

.hd-switch-path--b { background: var(--surface); }

.hd-switch-tag {
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--hackerday);
}

.hd-switch-path--b .hd-switch-tag { color: var(--muted); }

.hd-switch-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
}

.hd-switch-desc {
    font-size: 0.65rem;
    color: var(--muted);
    line-height: 1.5;
}

/* ──────────────────────────────────────────────────────
   USE CASES
   ────────────────────────────────────────────────────── */
.hd-usecase-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 48px;
}

.hd-usecase-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 26px 24px;
    transition: border-color 0.2s ease;
}

.hd-usecase-card:hover {
    border-color: rgba(var(--hackerday-rgb), 0.35);
}

.hd-usecase-num {
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    color: var(--hackerday);
    font-weight: 600;
    margin-bottom: 12px;
}

.hd-usecase-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 10px;
    letter-spacing: -0.01em;
}

.hd-usecase-body {
    font-size: 0.82rem;
    line-height: 1.7;
    color: var(--muted);
    margin-bottom: 16px;
}

.hd-usecase-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.hd-usecase-tags span {
    font-size: 0.62rem;
    letter-spacing: 0.06em;
    padding: 4px 9px;
    border: 1px solid var(--line);
    border-radius: 4px;
    color: var(--muted);
}

/* ──────────────────────────────────────────────────────
   EVENT CREDIT STRIP
   ────────────────────────────────────────────────────── */
.hd-event-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px 22px;
    padding: 22px 24px;
    margin: 8px 0 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    color: var(--muted);
    text-align: center;
}

.hd-event-strip strong {
    color: var(--text);
    font-weight: 600;
}

.hd-event-sep {
    color: var(--line-strong);
}

/* ──────────────────────────────────────────────────────
   RESPONSIVE
   ────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .hd-hero {
        grid-template-columns: 1fr;
        gap: 40px;
        padding: 40px 0 40px;
        min-height: unset;
    }

    .hd-hero-stage { order: -1; }

    .hd-board-img { max-height: 46vh; }

    .hd-display-specs { grid-template-columns: 1fr; }

    .hd-bus-row {
        grid-template-columns: 64px 1fr;
        row-gap: 4px;
    }

    .hd-bus-role {
        grid-column: 1 / -1;
        text-align: left;
    }
}

@media (max-width: 560px) {
    .hd-pad {
        grid-template-columns: repeat(3, 38px);
        grid-template-rows: repeat(3, 38px);
    }

    .hd-pad-row { gap: 16px; }

    .hd-switch-split { grid-template-columns: 1fr; }
}
