/* Senpai Stream — dark, content-first theme */

:root {
    --bg: #0a0b0f;
    --bg-elevated: #14161c;
    --bg-elevated-hover: #191c24;
    --border: #24262f;
    --text: #e7e8ec;
    --text-muted: #9a9ca6;
    --accent: #ff5a3c;
    --accent-hover: #ff7857;
    --accent-text: #14161c;
    --max-width: 1100px;
}

* {
    box-sizing: border-box;
}

html {
    background: var(--bg);
    color-scheme: dark;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
        Arial, sans-serif;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

/* Skip link */
body > a:first-of-type {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--accent);
    color: var(--accent-text);
    padding: 0.75rem 1.25rem;
    border-radius: 0 0 8px 0;
    font-weight: 600;
    text-decoration: none;
    z-index: 200;
}

body > a:first-of-type:focus {
    left: 0;
}

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

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

h1,
h2,
h3 {
    line-height: 1.25;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin: 0 0 0.75rem;
}

p {
    color: var(--text-muted);
    margin: 0 0 1rem;
}

small {
    color: var(--text-muted);
}

/* Header */
header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(10, 11, 15, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

header > p:first-child {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1rem 1.5rem 0;
    font-size: 1.1rem;
}

header nav {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0.6rem 1.5rem 1rem;
    position: relative;
}

header nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1.1rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

header nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.88rem;
    white-space: nowrap;
    transition: color 0.15s ease;
}

header nav a:hover,
header nav a.is-active {
    color: var(--accent);
}

.nav-toggle {
    display: none;
}

/* Hero */
#home {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 3rem 1.5rem 3.5rem;
    background:
        radial-gradient(
            ellipse 60% 50% at 15% -10%,
            rgba(255, 90, 60, 0.14),
            transparent
        ),
        var(--bg);
}

#home h1 {
    font-size: clamp(2rem, 4.5vw, 3rem);
    max-width: 22ch;
}

#home p {
    max-width: 68ch;
}

/* CTA lists */
ul.cta-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0;
    margin: 1.5rem 0;
}

ul.cta-list li {
    margin: 0;
}

ul.cta-list a {
    display: inline-block;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.75rem 1.5rem;
    border-radius: 999px;
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
    transition:
        transform 0.15s ease,
        background 0.15s ease,
        border-color 0.15s ease;
}

ul.cta-list a:hover {
    border-color: var(--text-muted);
}

ul.cta-list a.cta-primary {
    background: var(--accent);
    color: var(--accent-text);
    border-color: var(--accent);
    box-shadow: 0 8px 24px -8px rgba(255, 90, 60, 0.6);
}

ul.cta-list a.cta-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    transform: translateY(-1px);
}

/* Main layout */
main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem 4rem;
}

main > section {
    padding: 3rem 0;
    border-top: 1px solid var(--border);
}

main > section:first-child {
    border-top: none;
}

section > h2 {
    font-size: 1.55rem;
}

section > p {
    max-width: 70ch;
}

/* Card grid for ItemList sections */
section:has(> article) {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    align-items: start;
}

section:has(> article) > h2,
section:has(> article) > p {
    grid-column: 1 / -1;
    margin-bottom: 0;
}

section:has(> article) > p {
    margin-bottom: 0.5rem;
}

article {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    transition:
        border-color 0.15s ease,
        background 0.15s ease;
}

article:hover {
    border-color: #34363f;
    background: var(--bg-elevated-hover);
}

article h3 {
    font-size: 1.05rem;
}

article > div > p:first-of-type {
    font-size: 0.85rem;
    color: var(--text-muted);
}

article > div > p:first-of-type time {
    color: var(--text);
}

article details {
    margin: 0.75rem 0;
    border-top: 1px solid var(--border);
    padding-top: 0.75rem;
}

article summary {
    cursor: pointer;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 500;
}

article details p {
    margin-top: 0.6rem;
    margin-bottom: 0;
}

article > div > p:last-of-type a,
article > div > p:last-child a {
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
}

article > div > p:last-of-type a:hover {
    text-decoration: underline;
}

/* Genre / collection chip lists */
#genres h3,
#collections h3 {
    margin-top: 2rem;
    font-size: 1.05rem;
}

#genres h3:first-of-type,
#collections h3:first-of-type {
    margin-top: 1.5rem;
}

#genres ul,
#collections ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0;
    margin: 0 0 1rem;
}

#genres li,
#collections li {
    margin: 0;
}

#genres li a,
#collections li a {
    display: inline-block;
    padding: 0.4rem 0.9rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 999px;
    text-decoration: none;
    color: var(--text);
    font-size: 0.85rem;
    transition: border-color 0.15s ease;
}

#genres li a:hover,
#collections li a:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Guides */
#guides h3 {
    margin-top: 2.5rem;
    font-size: 1.1rem;
}

#guides h3:first-of-type {
    margin-top: 0;
}

#guides dl {
    display: grid;
    grid-template-columns: max-content 1fr;
    column-gap: 1.5rem;
    row-gap: 0.9rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin: 0 0 1.5rem;
}

#guides dt {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

#guides dd {
    margin: 0;
    color: var(--text-muted);
    max-width: 60ch;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    display: block;
    overflow-x: auto;
    margin: 0 0 1.5rem;
    font-size: 0.88rem;
}

caption {
    text-align: left;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.6rem;
}

th,
td {
    text-align: left;
    padding: 0.65rem 0.9rem;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

thead th {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

tbody tr:hover {
    background: var(--bg-elevated);
}

/* Details / FAQ */
#faq details {
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
}

#faq details:first-of-type {
    border-top: 1px solid var(--border);
}

#faq summary {
    cursor: pointer;
    color: var(--text);
    font-weight: 500;
}

#faq details p {
    margin-top: 0.75rem;
    max-width: 70ch;
}

/* Footer */
footer {
    border-top: 1px solid var(--border);
}

footer > * {
    max-width: var(--max-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

footer {
    padding-top: 2.5rem;
    padding-bottom: 3rem;
}

footer h2 {
    font-size: 1.1rem;
}

footer img {
    height: 40px;
    width: auto;
    opacity: 0.9;
}

footer nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    list-style: none;
    padding: 0;
    margin: 1rem 0 1.5rem;
}

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

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

footer p {
    font-size: 0.85rem;
}

/* Back to top */
#back-to-top {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 60;
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--accent-text);
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    box-shadow: 0 8px 24px -8px rgba(255, 90, 60, 0.6);
    transition:
        background 0.15s ease,
        transform 0.15s ease;
}

#back-to-top.is-visible {
    display: flex;
}

#back-to-top:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

/* Mobile nav */
@media (max-width: 720px) {
    .nav-toggle {
        display: inline-flex;
        align-items: center;
        gap: 0.4rem;
        background: var(--bg-elevated);
        color: var(--text);
        border: 1px solid var(--border);
        border-radius: 999px;
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
        cursor: pointer;
    }

    header nav ul {
        display: none;
        flex-direction: column;
        gap: 0.75rem;
        padding-top: 0.75rem;
    }

    header nav ul.is-open {
        display: flex;
    }
}
