/*
 * Klang im Kopf besser - theme on top of Pico CSS.
 * Mobile first: base rules target small screens, media queries add layout for wider ones.
 */

/* ---------- Tokens (Pico variables + our own) ---------- */
[data-theme="dark"] {
    --ink: #14111c;
    --ink-raised: #1d1828;
    --ink-line: #2e2640;
    --text: #ece6f4;
    --text-muted: #a89fba;
    --accent: #ff8a5b;
    --accent-strong: #ff9f78;
    --accent-2: #c79bff;

    --pico-font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    --pico-background-color: var(--ink);
    --pico-color: var(--text);
    --pico-muted-color: var(--text-muted);
    --pico-muted-border-color: var(--ink-line);
    --pico-h1-color: #fff;
    --pico-h2-color: #fff;
    --pico-h3-color: #fff;
    --pico-h4-color: #fff;
    --pico-card-background-color: var(--ink-raised);
    --pico-card-sectioning-background-color: var(--ink-raised);
    --pico-card-box-shadow: none;
    --pico-dropdown-background-color: var(--ink-raised);

    --pico-primary: var(--accent);
    --pico-primary-background: var(--accent);
    --pico-primary-border: var(--accent);
    --pico-primary-underline: rgb(255 138 91 / 0.5);
    --pico-primary-hover: var(--accent-strong);
    --pico-primary-hover-background: var(--accent-strong);
    --pico-primary-hover-border: var(--accent-strong);
    --pico-primary-hover-underline: var(--accent-strong);
    --pico-primary-focus: rgb(255 138 91 / 0.35);
    --pico-primary-inverse: #1a0f0b;

    --pico-secondary: var(--text-muted);
    --pico-secondary-hover: var(--text);
    --pico-secondary-border: var(--ink-line);
    --pico-secondary-hover-border: var(--text-muted);
}

:root {
    --header-height: 4rem;
    --section-gap: 4rem;
    scroll-padding-top: calc(var(--header-height) + 1rem);
}

@media (prefers-reduced-motion: no-preference) {
    :root { scroll-behavior: smooth; }
}

/* ---------- Basics ---------- */
h1, h2, h3, h4 { letter-spacing: -0.02em; text-wrap: balance; }
p { text-wrap: pretty; }
.muted { color: var(--pico-muted-color); }
.lead { font-size: 1.125rem; color: var(--text); }

.eyebrow {
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
}
hgroup { margin-bottom: 1.5rem; }
hgroup > .eyebrow { margin-bottom: 0.25rem; }
/* Pico treats an hgroup's last child as a muted subtitle; ours is the real heading. */
hgroup > h2:not(:first-child):last-child {
    font-size: clamp(1.75rem, 6vw, 2.5rem);
    font-weight: 800;
    color: var(--pico-h2-color);
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -4rem;
    z-index: 100;
    padding: 0.5rem 1rem;
    border-radius: var(--pico-border-radius);
    background: var(--accent);
    color: var(--pico-primary-inverse);
}
.skip-link:focus { top: 1rem; }

main > section { margin-block: var(--section-gap); }

/* ---------- Header menu ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgb(20 17 28 / 0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--ink-line);
}
.site-header nav { min-height: var(--header-height); }

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 800;
    color: #fff;
    text-decoration: none;
}
.brand span { font-size: 1rem; }

/* Right-hand list holds the wide links, the language switcher and the narrow menu. */
.site-header nav > ul:last-child { align-items: center; }
.nav-wide { display: none; }
.nav-narrow summary { font-weight: 600; }
.nav-cta { padding: 0.45rem 1rem; }

/* Language switcher: small "DE | EN" pill, current language highlighted */
.lang-switch {
    display: inline-flex;
    padding: 0.15rem;
    border: 1px solid var(--ink-line);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 1;
}
.lang-switch > a,
.lang-switch > span {
    margin: 0;
    padding: 0.35rem 0.55rem;
    border-radius: 999px;
    text-decoration: none;
}
.lang-switch > a { color: var(--text-muted); }
.lang-switch > a:hover,
.lang-switch > a:focus-visible { color: var(--text); background: var(--ink-raised); }
.lang-switch > [aria-current] { color: var(--pico-primary-inverse); background: var(--accent); }

.brand span,
.nav-narrow summary { white-space: nowrap; }

/* Phones: logo + language switch + menu don't fit next to the full name, so show only the logo
   (the link keeps its aria-label, and the hero repeats the title right below). */
@media (max-width: 429.98px) {
    .brand span { display: none; }
}

@media (min-width: 768px) {
    .nav-wide { display: inline-block; }
    .nav-narrow { display: none; }
}

/* ---------- Hero ---------- */
.hero {
    position: relative;
    overflow: hidden;
    padding-block: 2.5rem 3rem;
    background:
        radial-gradient(60rem 30rem at 85% -10%, rgb(199 155 255 / 0.18), transparent 60%),
        radial-gradient(40rem 25rem at -10% 110%, rgb(255 138 91 / 0.14), transparent 60%);
    border-bottom: 1px solid var(--ink-line);
}
.hero-grid { display: grid; gap: 2.5rem; }

.hero h1 {
    margin-bottom: 1rem;
    font-size: clamp(2.6rem, 11vw, 5.5rem);
    font-weight: 900;
    line-height: 0.95;
}
.hero h1 em {
    display: block;
    font-weight: 300;
    color: var(--accent);
}
.hero .lead { max-width: 36ch; }

.hero-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-block: 1.75rem;
}
.hero-actions [role="button"] { width: 100%; }

.hero-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0;
    margin: 0;
}
.hero-facts li {
    list-style: none;
    margin: 0;
    padding: 0.3rem 0.8rem;
    border: 1px solid var(--ink-line);
    border-radius: 999px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.hero-cover {
    position: relative;
    margin: 0 auto;
    max-width: 22rem;
}
.hero-cover img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 1.5rem;
    box-shadow: 0 2rem 4rem -1.5rem rgb(0 0 0 / 0.7), 0 0 0 1px var(--ink-line);
    transform: rotate(-2deg);
}

/* Little equalizer under the cover */
.equalizer {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 0.35rem;
    height: 2.5rem;
    margin-top: 1.25rem;
}
.equalizer span {
    width: 0.4rem;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(to top, var(--accent), var(--accent-2));
    transform-origin: bottom;
    transform: scaleY(0.35);
}
@media (prefers-reduced-motion: no-preference) {
    .equalizer span { animation: eq 1.2s ease-in-out infinite alternate; }
    .equalizer span:nth-child(2n) { animation-duration: 0.9s; }
    .equalizer span:nth-child(3n) { animation-duration: 1.5s; animation-delay: -0.4s; }
    .equalizer span:nth-child(4n) { animation-delay: -0.7s; }
}
@keyframes eq {
    from { transform: scaleY(0.2); }
    to   { transform: scaleY(1); }
}

@media (min-width: 576px) {
    .hero-actions { flex-direction: row; flex-wrap: wrap; }
    .hero-actions [role="button"] { width: auto; }
}
@media (min-width: 1024px) {
    .hero { padding-block: 5rem; }
    .hero-grid {
        grid-template-columns: 1.3fr 1fr;
        align-items: center;
        gap: 4rem;
    }
    .hero-cover { max-width: none; }
}

/* ---------- Episodes ---------- */
.episode { margin-bottom: 0; border: 1px solid var(--ink-line); }
.episode > header,
.episode > footer { background: transparent; }
.episode > header { padding-bottom: 0; margin-bottom: 0.75rem; border-bottom: 0; }
.episode-meta + h3, .episode-meta + h4 { margin-top: 0.25rem; }
.episode > footer { margin-top: 1rem; padding-top: 0; border-top: 0; }
.episode h3, .episode h4 { margin-bottom: 0; }

.episode-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
    color: var(--text-muted);
}
.episode-number { font-weight: 800; color: var(--accent); }

.episode audio { display: block; width: 100%; }

.episode--featured {
    border-color: transparent;
    background:
        linear-gradient(var(--ink-raised), var(--ink-raised)) padding-box,
        linear-gradient(135deg, var(--accent), var(--accent-2)) border-box;
}
.episode--featured h3 { font-size: clamp(1.5rem, 5vw, 2.25rem); }

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

@media (min-width: 768px) {
    .episode-list { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- About / contact two-column split ---------- */
.split { display: grid; gap: 0.5rem; }

.facts {
    display: grid;
    gap: 1rem;
    margin: 1.5rem 0 0;
}
.facts div {
    padding: 1rem;
    border-left: 3px solid var(--accent);
    background: var(--ink-raised);
    border-radius: 0 var(--pico-border-radius) var(--pico-border-radius) 0;
}
.facts dt { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); }
.facts dd { margin: 0.25rem 0 0; font-weight: 600; }

@media (min-width: 768px) {
    .split { grid-template-columns: 1fr 2fr; gap: 3rem; }
    .facts { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Hosts ---------- */
.host-grid { display: grid; gap: 1rem; }
.host {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 0;
    border: 1px solid var(--ink-line);
}
.host h3 { margin-bottom: 0.15rem; font-size: 1.2rem; }
.host p:last-child { margin-bottom: 0; }
.host-role { margin-bottom: 0.5rem; font-size: 0.85rem; color: var(--accent-2); }

.avatar {
    flex: none;
    display: grid;
    place-items: center;
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 50%;
    object-fit: cover;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--pico-primary-inverse);
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

@media (min-width: 768px) {
    .host-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Subscribe ---------- */
.subscribe {
    padding: 2rem 1.25rem;
    border-radius: 1.5rem;
    text-align: center;
    background:
        radial-gradient(30rem 15rem at 50% 0%, rgb(255 138 91 / 0.16), transparent 70%),
        var(--ink-raised);
    border: 1px solid var(--ink-line);
}
.subscribe hgroup, .subscribe > p { margin-inline: auto; max-width: 40ch; }

.platforms {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
    gap: 0.75rem;
    padding: 0;
    margin: 1.5rem 0 0;
}
.platforms li { list-style: none; margin: 0; }
.platforms [role="button"] { width: 100%; }

@media (min-width: 768px) {
    .subscribe { padding: 3rem; }
}

/* ---------- Legal pages ---------- */
.legal { max-width: 45rem; margin-block: 3rem; }
.legal h2 { margin-top: 1.5rem; font-size: 1.25rem; }

/* ---------- Footer ---------- */
.site-footer {
    margin-top: var(--section-gap);
    padding-block: 2.5rem 1rem;
    border-top: 1px solid var(--ink-line);
    background: #0f0c15;
}
.footer-grid { display: grid; gap: 1.5rem; }
.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.25rem;
}
.site-footer nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    padding: 0;
    margin: 0;
}
.site-footer nav li { list-style: none; margin: 0; padding: 0; }
.copyright { margin: 1.5rem 0 0; }

@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr;
        align-items: start;
    }
    .site-footer nav ul { flex-direction: column; }
}
