/* quayside – single-page dark theme, rehash-inspired.
 * Black background, white text, Inter, square buttons. */

:root {
    --bg: #000;
    --surface: #111;
    --surface-2: #1a1a1a;
    --border: rgba(255, 255, 255, 0.14);
    --text: #fff;
    --muted: rgba(255, 255, 255, 0.65);
    --cta-bg: #fff;
    --cta-text: #000;
    --card: #0d0d0d;
    --radius: 22px;
    --header-h: 57px;
}

* { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Inter", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    font-size: 16px;
    /* Locked stage: the page itself never scrolls, so scrolling can never
       change cards. Cards scroll inside themselves; buttons flip cards. */
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100svh;
    overflow: hidden;
}

main {
    flex: 1 1 auto;
    min-height: 0;
}

::selection { background: var(--text); color: var(--bg); }

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

img { max-width: 100%; height: auto; }

/* Skip link */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: #fff;
    color: #000;
    padding: 8px 12px;
    z-index: 2000;
}

.skip-link:focus { left: 8px; top: 8px; }

/* Sticky nav */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.92);
    border-bottom: 1px solid var(--border);
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    max-width: 1000px;
    margin: 0 auto;
    padding: 12px 20px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-weight: 800;
    font-size: 20px;
    letter-spacing: -0.5px;
}

.brand img { display: block; border-radius: 4px; }

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links a {
    position: relative;
    display: inline-block;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 12px;
    color: var(--muted);
    transition: color 0.2s ease;
    white-space: nowrap;
}

.nav-links a::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 4px;
    height: 1px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
    color: var(--text);
}

.nav-links a:hover::after,
.nav-links a:focus-visible::after,
.nav-links a.active::after {
    transform: scaleX(1);
}

.nav-links a.active { color: var(--text); }

.nav-links a:focus-visible,
.brand:focus-visible,
.btn:focus-visible {
    outline: 2px solid var(--text);
    outline-offset: 2px;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    padding: 9px 11px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 0;
    cursor: pointer;
}

.nav-toggle .bar {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
}

/* Hero — first card in the button-driven deck. Only the .active card is
   shown; a taller hero scrolls inside itself, never flipping away. */
.hero {
    display: none;
    height: 100%;
    overflow-y: auto;
    /* must stay auto: content scrolls inside the visible card only */
    overscroll-behavior-y: auto;
    -webkit-overflow-scrolling: touch;
    flex-direction: column;
    max-width: 1000px;
    margin: 0 auto;
    padding: 48px 20px;
    text-align: center;
    scroll-margin-top: var(--header-h);
}

.hero.active {
    display: flex;
    animation: card-in 0.45s ease;
}

/* margin:auto centers when content fits, collapses to top-aligned when it
   overflows — unlike justify-content:center, the top can never be cut off */
.hero-inner {
    margin: auto 0;
    width: 100%;
}

.hero-logo {
    width: min(220px, 50vw);
    height: auto;
    border-radius: 8px;
}

.hero h1 {
    margin: 20px 0 4px;
    font-size: clamp(48px, 10vw, 96px);
    font-weight: 800;
    letter-spacing: -3px;
    line-height: 1;
}

.tagline {
    margin: 0 0 28px;
    color: var(--muted);
    font-size: 18px;
}

.hero-cta {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 0;
}

.btn {
    display: inline-block;
    background: var(--cta-bg);
    color: var(--cta-text);
    text-decoration: none;
    font-weight: 700;
    font-size: 15px;
    padding: 12px 28px;
    border: 1px solid var(--cta-bg);
    border-radius: 0;
    transition: opacity 0.2s ease;
}

.btn:hover { opacity: 0.85; }

.btn-ghost {
    background: transparent;
    color: var(--text);
    border-color: var(--border);
}

/* Deck down-button — small round button, pinned to the card's bottom-right
   corner. This is the ONLY way to change cards; scrolling never does. */
.deck-next {
    display: block;
    width: 48px;
    height: 48px;
    margin: 20px 0 4px auto;
    position: sticky;
    bottom: 16px;
    background: var(--cta-bg);
    color: var(--cta-text);
    border: 1px solid var(--cta-bg);
    border-radius: 50%;
    font-size: 20px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    z-index: 6;
    transition: opacity 0.2s ease;
}

.deck-next:hover { opacity: 0.85; }

.deck-next:focus-visible {
    outline: 2px solid var(--text);
    outline-offset: 2px;
}

/* Deck cards — only the .active card is shown, rising from the bottom when
   its down button is pressed. Scrolling never changes cards; it only moves
   content inside the visible card. */
.section {
    display: none;
    height: 100%;
    overflow-y: auto;
    /* must stay auto: content scrolls inside the visible card only */
    overscroll-behavior-y: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px 48px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius) var(--radius) 0 0;
    scroll-margin-top: var(--header-h);
}

.section.active {
    display: block;
    animation: card-in 0.45s ease;
}

@keyframes card-in {
    from { transform: translateY(48px); opacity: 0; }
    to { transform: none; opacity: 1; }
}

/* Inner-card scrollbars — slim and theme-matched instead of the chunky OS
   default. (Mobile overlays its own auto-hiding bar; this styles desktop
   Firefox via scrollbar-* and Brave/Chrome/Safari via ::-webkit-*.) */
.hero,
.section {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
}

.hero::-webkit-scrollbar,
.section::-webkit-scrollbar {
    width: 8px;
}

.hero::-webkit-scrollbar-track,
.section::-webkit-scrollbar-track {
    background: transparent;
}

.hero::-webkit-scrollbar-thumb,
.section::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.22);
    background-clip: padding-box;
    border: 2px solid transparent;
    border-radius: 8px;
}

.hero::-webkit-scrollbar-thumb:hover,
.section::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.45);
    background-clip: padding-box;
}

/* Bottom sentinel (see scripts.js) + "scroll for more" hint. The hint is
   sticky to the card bottom, so it floats above the content without
   scrolling away; pointer-events:none so it never eats touches. Shown
   only via .has-more while unread content remains below. */
.bottom-sentinel {
    height: 1px;
    width: 1px;
}

.more-hint {
    display: none;
    position: sticky;
    bottom: 84px;
    margin: 12px 0 0;
    text-align: center;
    pointer-events: none;
    z-index: 5;
}

.more-hint span {
    display: inline-block;
    background: rgba(0, 0, 0, 0.78);
    border: 1px solid var(--border);
    padding: 6px 14px;
    font-size: 13px;
    color: var(--muted);
}

.has-more .more-hint { display: block; }

.section h2 {
    margin: 0 0 8px;
    font-size: clamp(28px, 5vw, 40px);
    font-weight: 800;
    letter-spacing: -1.5px;
}

.section h3 {
    margin: 32px 0 8px;
    font-size: 22px;
    letter-spacing: -0.5px;
}

.section p { color: var(--text); }
.section p a { text-underline-offset: 3px; }
.muted, .section .placeholder-note { color: var(--muted); }

/* Cards + tracks */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.card {
    background: #161616;
    border: 1px solid var(--border);
    border-radius: 0;
    padding: 20px;
}

.ep-cover {
    display: block;
    width: 100%;
    max-width: 320px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border: 1px solid var(--border);
    margin: 0 0 14px;
}

.card h4 { margin: 0 0 8px; font-size: 17px; }
.card p { margin: 0 0 12px; color: var(--muted); font-size: 15px; }
.card ol { margin: 0 0 12px; padding-left: 20px; color: var(--muted); font-size: 15px; }
.card code { color: var(--text); }

.track {
    background: #202020;
    border: 1px solid var(--border);
    padding: 12px;
    margin: 12px 0;
}

.track h5 { margin: 0 0 8px; font-size: 14px; }
.track audio { width: 100%; }

.placeholder-note {
    border: 1px dashed var(--border);
    padding: 10px 12px;
    font-size: 14px;
}

/* Contact list */
#contact ul { list-style: none; margin: 16px 0 0; padding: 0; }
#contact li { padding: 10px 0; border-bottom: 1px solid var(--border); }

.fineprint {
    color: var(--muted);
    font-size: 13px;
    text-align: center;
    margin: 24px 0 0;
}

/* Footer lives below the locked stage and can never be scrolled to, so it
   stays hidden; its line survives as .fineprint inside the Contact card. */
footer {
    display: none;
}

footer p { margin: 4px 0; }
footer .socials a { color: var(--muted); text-decoration: none; padding: 4px 6px; }
footer .socials a:hover { color: var(--text); text-decoration: underline; }

/* Mobile nav */
@media (max-width: 720px) {
    .nav-toggle { display: flex; }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        background: #000;
        border-bottom: 1px solid var(--border);
        padding: 8px 12px 12px;
    }

    .nav-links.open { display: flex; }

    .nav-links a {
        display: block;
        padding: 12px;
        font-size: 16px;
    }

    .hero { padding: 56px 20px 48px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .nav-links a,
    .nav-links a::after,
    .btn { transition: none; }
    .hero.active,
    .section.active { animation: none; }
    .deck-next { transition: none; }
}
