:root {
    --bg: #1A2028;
    --bg-elevated: #202834;
    --bg-selection: #384454;
    --fg: #F8F4EC;
    --fg-muted: #9C968A;
    --blue-primary: #8AA8C5;
    --blue-secondary: #93B1CC;
    --blue-highlight: #BDD2E4;
    --cream-primary: #E5BF8D;
    --cream-secondary: #D8C3A0;
    --rust-primary: #C86B34;
    --rust-secondary: #D9753A;
    --shadow: rgba(7, 12, 18, 0.38);
    color-scheme: dark;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100%;
    margin: 0;
    background:
        radial-gradient(circle at top left, rgba(138, 168, 197, 0.14), transparent 34rem),
        linear-gradient(180deg, #1A2028 0%, #151A21 100%);
    color: var(--fg);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    color: var(--blue-primary);
}

a:hover {
    color: var(--blue-highlight);
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

:focus-visible {
    outline: 3px solid rgba(189, 210, 228, 0.9);
    outline-offset: 3px;
}

.app-shell {
    width: min(100%, 980px);
    min-height: 100vh;
    margin: 0 auto;
    padding: 4rem 1.25rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.site-header {
    text-align: center;
}

.eyebrow {
    margin: 0 0 0.7rem;
    color: var(--blue-primary);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    overflow-wrap: anywhere;
}

h1 {
    max-width: 760px;
    margin: 0 auto;
    color: var(--fg);
    font-size: clamp(2.25rem, 8vw, 5rem);
    font-weight: 350;
    letter-spacing: -0.06em;
    line-height: 0.95;
}

.lede {
    max-width: 620px;
    margin: 1.25rem auto 0;
    color: var(--cream-secondary);
    font-size: 1.08rem;
    line-height: 1.7;
}

.source-link {
    margin: 1rem 0 0;
    font-size: 0.95rem;
}

.directory {
    display: grid;
    gap: 1rem;
}

.toolbar,
.empty-state,
.address-card,
.modal-panel,
.update-toast {
    background: rgba(32, 40, 52, 0.88);
    border: 1px solid rgba(189, 210, 228, 0.15);
    box-shadow: 0 22px 60px var(--shadow);
    backdrop-filter: blur(14px);
}

.toolbar {
    padding: 1rem;
    border-radius: 1.2rem;
}

.toolbar label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--cream-primary);
    font-size: 0.9rem;
    font-weight: 700;
}

.toolbar input {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(138, 168, 197, 0.42);
    border-radius: 0.9rem;
    background: rgba(26, 32, 40, 0.86);
    color: var(--fg);
}

.toolbar input::placeholder {
    color: var(--fg-muted);
}

.result-count {
    margin: 0.7rem 0 0;
    color: var(--fg-muted);
    font-size: 0.9rem;
}

.address-list {
    display: grid;
    gap: 1rem;
}

.address-card {
    width: 100%;
    padding: 1rem;
    border-radius: 1.2rem;
    color: inherit;
    text-align: left;
    transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.address-card:hover {
    border-color: rgba(189, 210, 228, 0.38);
    background: rgba(38, 48, 63, 0.92);
    transform: translateY(-1px);
}

.card-topline {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.address-card h2 {
    margin: 0;
    color: var(--fg);
    font-size: 1.2rem;
    font-weight: 620;
}

.address-card p {
    margin: 0.55rem 0 0;
    color: var(--cream-secondary);
    line-height: 1.55;
}

.address-preview,
code {
    color: var(--blue-highlight);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 0.84rem;
    line-height: 1.5;
    word-break: break-all;
}

.address-preview {
    display: block;
    margin-top: 0.85rem;
}

.tags,
.socials {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.8rem;
}

.tag,
.social-link {
    padding: 0.26rem 0.55rem;
    border: 1px solid rgba(138, 168, 197, 0.24);
    border-radius: 999px;
    background: rgba(26, 32, 40, 0.45);
    color: var(--blue-highlight);
    font-size: 0.78rem;
    text-decoration: none;
}

.empty-state {
    padding: 2rem;
    border-radius: 1.2rem;
    text-align: center;
}

.empty-state h2 {
    margin: 0;
    font-weight: 500;
}

.empty-state p {
    margin: 0.65rem 0 0;
    color: var(--fg-muted);
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 20;
    background: rgba(7, 12, 18, 0.72);
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: grid;
    place-items: center;
    padding: 1rem;
    overflow-y: auto;
}

.modal-panel {
    position: relative;
    width: min(100%, 850px);
    max-height: calc(100vh - 2rem);
    padding: 1.25rem;
    overflow-y: auto;
    border-radius: 1.35rem;
}

.modal-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1.5rem;
    align-items: start;
    margin-top: 2.6rem;
}

.modal h2 {
    margin: 0;
    font-size: clamp(1.7rem, 5vw, 3rem);
    font-weight: 400;
    letter-spacing: -0.04em;
}

.modal-description {
    color: var(--cream-secondary);
    line-height: 1.6;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.icon-button,
.copy-button,
.update-toast button {
    border: 1px solid rgba(138, 168, 197, 0.35);
    border-radius: 999px;
    background: transparent;
    color: var(--blue-highlight);
}

.icon-button,
.copy-button {
    padding: 0.45rem 0.7rem;
    font-size: 0.8rem;
}

.copy-button,
.update-toast button {
    border-color: transparent;
    background: var(--rust-primary);
    color: var(--fg);
}

.qr-card {
    width: 230px;
    min-height: 230px;
    padding: 0.75rem;
    border-radius: 1rem;
    background: var(--fg);
}

bitcoin-qr {
    display: block;
}

.detail-block {
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid rgba(189, 210, 228, 0.13);
    border-radius: 1rem;
    background: rgba(26, 32, 40, 0.5);
}

.detail-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.7rem;
}

.detail-heading h3 {
    margin: 0;
    color: var(--cream-primary);
    font-size: 0.9rem;
}

.app-footer {
    margin-top: auto;
    color: var(--fg-muted);
    font-size: 0.9rem;
    text-align: center;
}

.app-footer p {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.usa-icon {
    border-radius: 2px;
}

.update-toast {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.75rem;
    border-radius: 999px;
    color: var(--fg);
}

.update-toast button {
    padding: 0.35rem 0.65rem;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

[hidden] {
    display: none !important;
}

@media (max-width: 720px) {
    .app-shell {
        padding-top: 2.4rem;
    }

    .modal-grid {
        grid-template-columns: 1fr;
    }

    .qr-card {
        width: min(100%, 300px);
        min-height: 0;
    }
}
