/* ==========================================================================
   Reset, document shell, header, main, footer, motion.
   Page-level structure — anything that wraps the page content.
   ========================================================================== */

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-sans);
    font-feature-settings: "ss01", "ss02";
    font-weight: 400;
    background: var(--paper);
    color: var(--ink);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    letter-spacing: -0.005em;
}

/* Header — quiet masthead */
header {
    border-bottom: 1px solid var(--rule);
    background: var(--paper);
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: saturate(180%) blur(8px);
    -webkit-backdrop-filter: saturate(180%) blur(8px);
}

.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0.95rem 2rem;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1.5rem;
}

.wordmark {
    font-family: var(--font-serif);
    font-weight: 500;
    font-size: 1.25rem;
    letter-spacing: -0.025em;
    color: var(--ink);
    display: inline-flex;
    align-items: baseline;
    line-height: 1;
}

.wordmark::before {
    content: "";
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 2px;
    display: inline-block;
    transform: translateY(-1px);
    /* On the square only: a flex gap would also split "Nostr", "i", "a". */
    margin-right: 0.25rem;
}

.wordmark em {
    font-style: italic;
    font-weight: 400;
    color: var(--accent);
}

.header-meta {
    justify-self: center;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--ink-quiet);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-meta .dot-sep {
    width: 3px;
    height: 3px;
    background: var(--ink-faint);
    border-radius: 50%;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    font-family: var(--font-mono);
}

#sync-status {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--ink-quiet);
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* Main container — single editorial column */
main {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2.25rem 2rem 4rem;
    position: relative;
}

/* Footer */
footer {
    border-top: 1px solid var(--rule);
    margin-top: 2rem;
    padding: 1.5rem 2rem;
    font-family: var(--font-mono);
    font-size: 0.66rem;
    color: var(--ink-quiet);
    font-weight: 500;
    letter-spacing: 0.04em;
}

.footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

footer .seal { color: var(--accent); }

/* ==========================================================================
   MOTION — calm staggered reveal for sections on page load
   ========================================================================== */
@keyframes riseIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

header, .block { animation: riseIn 0.5s var(--ease-out) both; }

header { animation-delay: 0s; }
main > .block:nth-child(1) { animation-delay: 0.06s; }
main > .block:nth-child(2) { animation-delay: 0.12s; }
main > .block:nth-child(3) { animation-delay: 0.18s; }
main > .block:nth-child(4) { animation-delay: 0.24s; }
main > .block:nth-child(5) { animation-delay: 0.30s; }
main > .block:nth-child(6) { animation-delay: 0.36s; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==========================================================================
   PAGE-LEVEL RESPONSIVE
   ========================================================================== */
@media (max-width: 1100px) {
    main { padding: 2rem 1.5rem 3rem; }
    .header-inner { padding: 0.85rem 1.5rem; }
}

@media (max-width: 700px) {
    .header-inner {
        grid-template-columns: 1fr auto;
        gap: 0.75rem;
    }
    .header-meta { grid-row: 2; grid-column: 1 / -1; justify-self: start; }
    .header-meta > span { display: none; }
    main { padding: 1.5rem 1.1rem 2.5rem; }
    footer .footer-inner { flex-direction: column; text-align: center; }
}
