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

:root {
    /* Colors — X Black (AMOLED dark) */
    --bg: #000;
    --bg-subtle: #0a0a0a;
    --text: #e7e9ea;
    --text-muted: #71767b;
    --text-faint: #536471;
    --accent: #1d9bf0;
    --accent-light: #0a1219;
    --border: #2f3336;
    --border-dark: #2f3336;
    --error: #f4212e;
    --success: #00ba7c;

    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2.5rem;
    --space-xl: 4rem;
    --space-xxl: 6rem;

    /* Typography */
    --font-mono: 'JetBrains Mono', 'SF Mono', ui-monospace, monospace;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 17px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Nav */
nav {
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}

.nav-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

nav a {
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 400;
}

nav a:hover {
    color: var(--accent);
}

nav a.active {
    font-weight: 700;
}

/* Layout */
.container {
    max-width: 680px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

/* Hero */
.hero {
    padding: var(--space-xxl) 2rem var(--space-lg);
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.hero p {
    font-size: 1rem;
    color: var(--text);
}

.hero__count {
    font-size: 0.85rem;
    font-family: var(--font-mono);
    color: var(--text-faint);
    letter-spacing: 0.05em;
    margin-top: 1.5rem;
}

.tier-status {
    font-size: 0.8rem;
    color: var(--text-faint);
    font-style: italic;
    text-align: right;
    margin-bottom: 0.75rem;
}

.tier-status a {
    color: var(--text-faint);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.tier-status a:hover {
    color: var(--accent);
}

/* Headings */
h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.75rem;
}

h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.75rem;
    margin-top: 2rem;
}

p {
    color: var(--text);
}

code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    background: var(--bg-subtle);
    padding: 0.15rem 0.4rem;
    border: 1px solid var(--border);
    border-radius: 3px;
}

/* Forms */
.message-form {
    max-width: 600px;
    margin: 0 auto;
}

textarea {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text);
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: 3px;
    resize: vertical;
    min-height: 150px;
    max-height: 400px;
}

textarea:focus {
    outline: none;
    border-color: var(--accent);
    border-width: 2px;
}

textarea::placeholder {
    color: var(--text-faint);
}

.form-group small {
    display: block;
    text-align: right;
    color: var(--text-faint);
    font-size: 0.8rem;
    margin-top: 0.5rem;
    font-family: var(--font-mono);
}

.form-group small.at-limit {
    color: var(--error);
    font-weight: 600;
}

.errors {
    list-style: none;
    margin-top: 0.5rem;
}

.errors li {
    color: var(--error);
    font-size: 0.85rem;
    font-style: italic;
}

.form-rate-error {
    color: var(--error);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.message-form button[type="submit"] {
    display: block;
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    color: #000;
    background: var(--text);
    border: 1px solid var(--text);
    border-radius: 3px;
    cursor: pointer;
}

.message-form button[type="submit"]:hover {
    background: #d7dbdc;
}

.message-form button[type="submit"]:active {
    background: var(--text);
}

.message-form button[type="submit"]:disabled {
    background: var(--text-faint);
    border-color: var(--text-faint);
    cursor: not-allowed;
}

.nano-price-hint {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-faint);
    margin-top: 0.4rem;
    font-style: italic;
}

/* ALTCHA widget */
altcha-widget {
    display: block;
    margin-top: 0.5rem;
    --altcha-max-width: 100%;
    --altcha-color-base: var(--bg-subtle);
    --altcha-color-text: var(--text);
    --altcha-color-border: var(--border);
    --altcha-color-border-focus: var(--accent);
    --altcha-color-active: var(--accent);
    --altcha-color-footer-bg: var(--bg-subtle);
    --altcha-color-footer-text: var(--text-faint);
    --altcha-border-width: 1px;
    --altcha-border-radius: 3px;
}

/* Blockquote */
blockquote {
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    border-left: 3px solid var(--text);
    color: var(--text);
    font-style: italic;
}

.waiting {
    font-style: italic;
    color: var(--text-muted);
}

.countdown-urgent {
    color: var(--error);
    font-weight: 700;
    font-style: normal;
}

/* Search */
.search-wrapper {
    margin-bottom: var(--space-md);
}

.search-form {
    display: flex;
}

.search-input {
    width: 100%;
    height: 2.5rem;
    padding: 0 0.75rem;
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--text);
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: 3px;
    box-sizing: border-box;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent);
}

.search-input::placeholder {
    color: var(--text-faint);
}

/* Filter bar */
.filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-sm);
    gap: 0.75rem;
}

.filter-presets {
    display: flex;
    gap: 0.5rem;
}

.sort-toggle {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

.sort-toggle:hover {
    color: var(--accent);
}

.filter-btn {
    font-size: 0.75rem;
    padding: 0.2rem 0.55rem;
    border: none;
    background: none;
    color: var(--text-muted);
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

.filter-btn:hover {
    color: var(--accent);
}

.filter-btn.active {
    color: var(--accent);
    font-weight: 600;
}

/* Message stats */
.messages-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: var(--space-sm);
}

.match-count {
    font-weight: 600;
    color: var(--text);
    font-style: normal;
}


/* Feed */
.feed {
    display: flex;
    flex-direction: column;
}

.feed-entry {
    padding: var(--space-md) var(--space-sm);
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
    margin: 0 calc(var(--space-sm) * -1);
    border-radius: 3px;
}

.feed-entry:hover {
    background: var(--bg-subtle);
}

.feed-entry-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.feed-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-xs);
}

.feed-author {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.feed-avatar {
    display: inline-grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr 1fr;
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 2px;
    overflow: hidden;
    flex-shrink: 0;
}

.feed-avatar span {
    display: block;
}

.feed-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
}

.feed-time {
    font-size: 0.8rem;
    color: var(--text-faint);
}

.feed-number {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-faint);
    flex-shrink: 0;
}

.feed-content {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text);
    margin-bottom: var(--space-xs);
}

.feed-date {
    font-size: 0.75rem;
    color: var(--text-faint);
}

.no-results {
    color: var(--text-muted);
    font-style: italic;
}

.scroll-sentinel {
    height: 1px;
}

/* About */
.about-group {
    margin-bottom: var(--space-xxl);
}

.about-group:last-child {
    margin-bottom: 0;
}

.about-page section {
    margin-bottom: var(--space-xl);
}

.about-page section:last-child {
    margin-bottom: 0;
}

.about-lead p {
    font-size: 1.1rem;
}

.about-page h2 {
    margin-top: 0;
}

.about-page p {
    margin-bottom: 0.75rem;
    color: var(--text);
}

.about-page p:last-child {
    margin-bottom: 0;
}

.about-page a {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}

.about-page a:hover {
    text-decoration: underline;
}

.timeline {
    margin-top: 1rem;
    border-left: 1px solid var(--border);
    padding-left: 1.5rem;
}

.timeline-step {
    position: relative;
    padding-bottom: 1.5rem;
}

.timeline-step:last-child {
    padding-bottom: 0;
}

.timeline-step::before {
    content: '';
    position: absolute;
    left: -1.8rem;
    top: 0.45rem;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
}

.timeline-step strong {
    display: block;
    margin-bottom: 0.15rem;
}

.timeline-step p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0;
}

.use-cases {
    list-style: none;
    margin: 1rem 0 0;
    padding: 0;
}

.use-cases li {
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-size: 0.95rem;
}

.use-cases li:last-child {
    border-bottom: none;
}

ol {
    margin: 1rem 0 2rem 1.5rem;
    color: var(--text);
}

ol li {
    margin-bottom: 0.5rem;
}

/* Overlay */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 1rem;
}

.overlay-box {
    background: #0a0a0a;
    border: 1px solid #3a3a3a;
    border-radius: 3px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.overlay-box h2 {
    margin-top: 0;
}

.overlay-box blockquote {
    margin: 1rem 0;
    border-left-color: var(--text);
}

/* Payment overlay — QR */
.pay-qr {
    text-align: center;
    margin: 1.25rem 0;
}

.pay-qr__img {
    width: 180px;
    height: 180px;
    image-rendering: pixelated;
}

/* Payment overlay — sections */
.pay-section {
    position: relative;
    text-align: center;
    padding: 0.5rem 0;
    cursor: pointer;
    transition: background 0.15s;
    border-radius: 3px;
}

.pay-section:hover {
    background: var(--accent-light);
}

.pay-section:active {
    background: var(--bg-subtle);
}

.pay-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 0.3rem;
}

.pay-nano {
    display: block;
    font-size: 0.85rem;
    font-family: var(--font-mono);
    color: var(--text);
}

.pay-divider {
    border: none;
    border-top: 1px dashed var(--border);
    margin: 0.5rem 0;
}

.pay-addr {
    display: block;
    word-break: break-all;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 1.5;
    background: none;
    border: none;
    padding: 0;
    color: var(--text);
    max-width: 310px;
    margin: 0 auto;
}

/* Tap-to-copy toast */
.copy-toast {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    background: var(--text);
    color: var(--bg);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    pointer-events: none;
    animation: toast-fade 1.5s ease forwards;
}

@keyframes toast-fade {
    0%, 70% { opacity: 1; }
    100% { opacity: 0; }
}

/* Address highlighting */
.addr-prefix {
    color: #1a6bff;
}

.addr-suffix {
    color: #b8860b;
}

/* Payment overlay — countdown, warning, cancel */
.pay-countdown {
    text-align: center;
    margin: 1rem 0;
}

.pay-warning {
    font-size: 0.75rem;
    color: var(--text-faint);
    text-align: center;
}

.pay-cancel {
    text-align: center;
    margin-top: 0.75rem;
}

/* Open in wallet — mobile only */
.wallet-link-row {
    display: none;
    text-align: center;
    margin: 0 0 0.5rem;
}

.btn-open-wallet {
    display: block;
    width: 100%;
    padding: 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    color: #000;
    background: var(--text);
    border: 1px solid var(--text);
    border-radius: 3px;
    text-decoration: none;
    text-align: center;
}

.btn-open-wallet:hover {
    background: #d7dbdc;
}

@media (max-width: 768px) {
    .wallet-link-row {
        display: block;
    }
}

.btn-cancel-link {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: underline;
}

.btn-cancel-link:hover {
    color: var(--accent);
}


.btn-close-overlay {
    display: block;
    width: 100%;
    margin-top: 1.5rem;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    color: #000;
    background: var(--text);
    border: 1px solid var(--text);
    border-radius: 3px;
    cursor: pointer;
}

.btn-close-overlay:hover {
    background: #d7dbdc;
}

/* Confirmed / pinning overlay */
.pay-confirmed {
    text-align: center;
}

.pay-confirmed h2 {
    margin-bottom: 1.25rem;
}

.pay-confirmed__progress {
    height: 2px;
    background: var(--bg-subtle);
    margin: 0 0 1rem;
    overflow: hidden;
}

.pay-confirmed__bar {
    height: 100%;
    width: 30%;
    background: var(--text);
    animation: progress-slide 1.2s ease-in-out infinite;
}

@keyframes progress-slide {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(430%); }
}

.pay-confirmed__status {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 1.25rem;
}

/* Message detail */
.detail {
    max-width: 680px;
}

.detail-content {
    font-size: 1.1rem;
    line-height: 1.8;
    margin: var(--space-md) 0;
    padding: var(--space-sm) var(--space-md);
    border-left: 3px solid var(--text);
    color: var(--text);
    font-style: normal;
    background: none;
}

.detail-meta {
    border-top: 1px solid var(--border);
    padding-top: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.detail-row {
    display: flex;
    gap: var(--space-sm);
}

.detail-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-faint);
    min-width: 5rem;
    flex-shrink: 0;
    padding-top: 0.15rem;
}

.detail-value {
    font-size: 0.85rem;
    color: var(--text);
}

.detail-hash {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    word-break: break-all;
    background: none;
    border: none;
    padding: 0;
}

.detail-links {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.25rem;
}

.detail-links a {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-decoration: none;
}

.detail-links a::before {
    content: '\2197 ';
}

.detail-links a:hover {
    color: var(--accent);
}

.detail-permalink {
    border-top: 1px solid var(--border);
    padding-top: var(--space-md);
    margin-top: var(--space-md);
}

.detail-permalink-row {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    margin-top: 0.25rem;
}

.btn-copy {
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    background: none;
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 0.2rem 0.6rem;
    cursor: pointer;
    white-space: nowrap;
}

.btn-copy:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Sold out */
.sold-out {
    text-align: center;
    padding: 2rem 0;
}

.sold-out h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.sold-out p {
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.sold-out .btn {
    display: inline-block;
    margin-top: 1.5rem;
    padding: 0.6rem 1.4rem;
    background: var(--text);
    color: #000;
    border-radius: 3px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: inherit;
}

.sold-out .btn:hover {
    background: #d7dbdc;
}

/* Copyable (generic — used outside overlay too) */
.copyable {
    cursor: pointer;
}

/* Pricing table (about page) */
.pricing-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    margin: 1rem 0;
}

.pricing-table th,
.pricing-table td {
    text-align: left;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
}

.pricing-table th {
    background: var(--bg-subtle);
    font-weight: 600;
}

.pricing-table tr:nth-child(even) td {
    background: var(--bg-subtle);
}

/* Main content — grows to push footer down */
main {
    flex: 1;
}

/* Responsive */
@media (max-width: 600px) {
    .hero {
        padding: var(--space-xl) 1.5rem var(--space-lg);
    }

    .hero h1 {
        font-size: 2.25rem;
    }

    .container {
        padding: 2rem 1.5rem;
    }

    nav {
        padding: 0.8rem 1.5rem;
    }

    .nav-logo {
        font-size: 1.1rem;
    }

    .filter-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .detail-row {
        flex-direction: column;
        gap: 0.25rem;
    }

    .detail-label {
        min-width: auto;
    }
}
