/* =====================================================================
   Permutis – Hochtausch-Challenge Seite (htc-)
   ===================================================================== */

.htc-body {
    background: var(--bg, #0a0e1a);
    color: var(--text, #e5e7eb);
}

.htc-skip-link {
    position: absolute;
    inset-inline-start: 0;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    z-index: -1;
}
.htc-skip-link:focus {
    position: fixed;
    inset-inline-start: 1rem;
    top: 1rem;
    width: auto;
    height: auto;
    clip-path: none;
    padding: .5rem 1rem;
    background: var(--violet-600);
    color: var(--text-on-dark);
    z-index: 9999;
    border-radius: .5rem;
}

.htc-page {
    padding-bottom: 4rem;
}

/* ===== Hero ===== */
.htc-hero {
    padding: 4rem 0 2rem;
    background: linear-gradient(135deg, #1a1f3a 0%, #0a0e1a 100%);
    border-bottom: 1px solid rgba(108, 92, 231, .2);
}
.htc-hero .container {
    max-width: 880px;
    margin: 0 auto;
    text-align: center;
    padding: 0 1.25rem;
}
.htc-hero-eyebrow {
    display: inline-block;
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--text);
    background: rgba(34, 197, 94, .12);
    padding: .35rem .85rem;
    border-radius: 999px;
    margin-bottom: 1.25rem;
}
.htc-hero h1 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    margin: 0 0 1rem;
    color: var(--text);
    line-height: 1.15;
}
.htc-hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.15rem);
    color: var(--muted);
    line-height: 1.55;
    max-width: 700px;
    margin: 0 auto;
}

/* ===== Mobile TOC ===== */
.htc-mobile-toc {
    display: none;
    margin: 1rem 1.25rem;
    background: rgba(20, 26, 42, .7);
    border: 1px solid rgba(108, 92, 231, .25);
    border-radius: .65rem;
    padding: .5rem 1rem;
}
.htc-mobile-toc summary {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    color: var(--text);
    list-style: none;
}
.htc-mobile-toc summary::-webkit-details-marker { display: none; }
.htc-mobile-toc-nav {
    margin-top: .75rem;
    display: flex;
    flex-direction: column;
    gap: .4rem;
}
.htc-mobile-toc-link {
    color: var(--muted);
    text-decoration: none;
    padding: .35rem .5rem;
    border-radius: .4rem;
    font-size: .95rem;
}
.htc-mobile-toc-link:hover,
.htc-mobile-toc-link.is-active {
    color: var(--text);
    background: rgba(108, 92, 231, .12);
}
@media (max-width: 959px) {
    .htc-mobile-toc { display: block; }
}

/* ===== Layout ===== */
.htc-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 2rem;
    max-width: 1200px;
    margin: 2.5rem auto 0;
    padding: 0 1.25rem;
}
@media (max-width: 959px) {
    .htc-layout {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
}

/* ===== Sidebar ===== */
.htc-sidebar {
    position: sticky;
    top: 1rem;
    align-self: start;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    background: rgba(20, 26, 42, .55);
    border: 1px solid rgba(108, 92, 231, .15);
    border-radius: .75rem;
    padding: 1.25rem;
}
@media (max-width: 959px) {
    .htc-sidebar { display: none; }
}
.htc-sidebar-eyebrow {
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: .75rem;
}
.htc-toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: .15rem;
}
.htc-toc-link {
    display: block;
    color: var(--muted);
    text-decoration: none;
    padding: .5rem .65rem;
    border-radius: .4rem;
    font-size: .95rem;
    border-left: 2px solid transparent;
    transition: background .15s, color .15s, border-color .15s;
}
.htc-toc-link:hover {
    color: var(--text);
    background: rgba(108, 92, 231, .12);
}
.htc-toc-link.is-active {
    color: var(--text);
    background: rgba(108, 92, 231, .18);
    border-left-color: #6c5ce7;
    font-weight: 600;
}

/* ===== Content ===== */
.htc-content {
    min-width: 0;
}
.htc-section {
    padding-bottom: 2.5rem;
    margin-bottom: 2.5rem;
    border-bottom: 1px solid rgba(108, 92, 231, .12);
}
.htc-section:last-of-type {
    border-bottom: none;
}
.htc-section-intro {
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.55;
    margin: 0 0 .75rem;
}
.htc-section-heading {
    color: var(--text);
    font-size: clamp(1.4rem, 2.5vw, 1.85rem);
    margin: 0 0 1.5rem;
    line-height: 1.2;
}
.htc-sub {
    margin-bottom: 1.5rem;
}
.htc-sub:last-child {
    margin-bottom: 0;
}
.htc-sub-heading {
    color: var(--text);
    font-size: 1.1rem;
    margin: 0 0 .65rem;
    font-weight: 600;
}
.htc-sub p {
    color: var(--muted);
    line-height: 1.6;
    margin: 0 0 .85rem;
}

/* ===== How-List (7 Schritte) ===== */
.htc-how-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    counter-reset: htc-step;
}
.htc-how-item {
    background: rgba(20, 26, 42, .55);
    border: 1px solid rgba(108, 92, 231, .15);
    border-radius: .75rem;
    padding: 1.25rem 1.5rem 1.25rem 4.5rem;
    position: relative;
}
.htc-how-step {
    position: absolute;
    left: 1.25rem;
    top: 1.25rem;
    width: 2.25rem;
    height: 2.25rem;
    background: var(--violet-600);
    color: var(--text-on-dark);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(108, 92, 231, .4);
}
.htc-how-item .htc-sub-heading {
    margin-top: 0;
    color: var(--text);
}
.htc-how-item p {
    margin: 0;
}

/* ===== Rules-Grid (Karten) ===== */
.htc-rules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}
.htc-rule-card {
    background: rgba(20, 26, 42, .55);
    border: 1px solid rgba(239, 68, 68, .25);
    border-radius: .75rem;
    padding: 1.15rem 1.25rem;
    border-left: 4px solid #ef4444;
}
.htc-rule-card .htc-sub-heading {
    color: var(--text);
    margin-top: 0;
}
.htc-rule-card p {
    margin: 0;
}

/* ===== Punkte-Liste ===== */
.htc-points-list {
    list-style: none;
    padding: 0;
    margin: .75rem 0 0;
    display: flex;
    flex-direction: column;
    gap: .55rem;
}
.htc-points-list li {
    background: rgba(34, 197, 94, .08);
    border: 1px solid rgba(34, 197, 94, .2);
    border-radius: .5rem;
    padding: .65rem 1rem;
    color: var(--muted);
    position: relative;
    padding-left: 2.5rem;
}
.htc-points-list li::before {
    content: "★";
    position: absolute;
    left: 1rem;
    color: var(--text);
    font-size: 1.1rem;
}

/* ===== FAQ ===== */
.htc-faq-list {
    display: flex;
    flex-direction: column;
    gap: .65rem;
}
.htc-faq-item {
    background: rgba(20, 26, 42, .55);
    border: 1px solid rgba(108, 92, 231, .15);
    border-radius: .65rem;
    overflow: hidden;
    transition: border-color .15s;
}
.htc-faq-item[open] {
    border-color: rgba(108, 92, 231, .45);
}
.htc-faq-item summary {
    cursor: pointer;
    padding: 1rem 1.25rem;
    color: var(--text);
    font-weight: 500;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}
.htc-faq-item summary::-webkit-details-marker { display: none; }
.htc-faq-item summary::after {
    content: "+";
    color: var(--text);
    font-size: 1.5rem;
    line-height: 1;
    transition: transform .2s;
}
.htc-faq-item[open] summary::after {
    content: "−";
}
.htc-faq-answer {
    padding: 0 1.25rem 1.1rem;
    color: var(--muted);
    line-height: 1.55;
}

/* ===== CTA ===== */
.htc-cta {
    margin-top: 3rem;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(108, 92, 231, .15) 0%, rgba(34, 197, 94, .1) 100%);
    border: 1px solid rgba(108, 92, 231, .35);
    border-radius: 1rem;
    text-align: center;
}
.htc-cta h2 {
    color: var(--text);
    font-size: clamp(1.3rem, 2vw, 1.6rem);
    margin: 0 0 1.25rem;
}
.htc-cta-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    justify-content: center;
}
.htc-cta .btn {
    padding: .75rem 1.5rem;
    border-radius: .5rem;
    font-weight: 600;
    text-decoration: none;
    transition: transform .15s, box-shadow .15s;
}
.htc-cta .btn:hover {
    transform: translateY(-1px);
}
.htc-cta .btn-primary {
    background: var(--violet-600);
    color: var(--text-on-dark);
}
.htc-cta .btn-primary:hover {
    box-shadow: 0 6px 20px rgba(108, 92, 231, .4);
}
.htc-cta .btn-secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid rgba(108, 92, 231, .6);
}
.htc-cta .btn-secondary:hover {
    background: rgba(108, 92, 231, .12);
}

/* Paired page surfaces keep every paragraph legible in both themes. */
.htc-body {
    --htc-ink: #f4f6fc;
    --htc-surface: #141a2a;
    --htc-border: #424c65;
    --htc-example: #1b2337;
}
:root[data-theme="light"] .htc-body {
    --htc-ink: #0a0e1a;
    --htc-surface: #ffffff;
    --htc-border: #bdc5d6;
    --htc-example: #edf1fa;
}
html .htc-body .htc-page :is(h1, h2, h3, p, summary, .htc-faq-answer,
    .htc-toc-link, .htc-mobile-toc-link, .htc-sidebar-eyebrow, .htc-start-note) {
    color: var(--htc-ink);
}
html .htc-body :is(.htc-sidebar, .htc-mobile-toc, .htc-how-item, .htc-rule-card,
    .htc-faq-item, .htc-support-card) {
    background: var(--htc-surface);
    border-color: var(--htc-border);
}
.htc-page .htc-hero { padding-block: clamp(2.5rem, 5vw, 4rem) 2.5rem; }
.htc-page .htc-hero h1 { font-size: clamp(2rem, 4vw, 3.25rem); text-wrap: balance; }
.htc-hero-actions { margin-block: 1.5rem .85rem; }
.htc-start-note { margin: 0; font-size: .9rem; line-height: 1.55; }
.htc-page .htc-support { max-width: 1200px; padding: 2.5rem 1.25rem 0; }
.htc-support > h2 { text-align: center; font-size: clamp(1.5rem, 3vw, 2rem); margin: 0 0 1.5rem; }
.htc-support-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.htc-support-card { border: 1px solid var(--htc-border); border-radius: 1.1rem; padding: 1.5rem; }
.htc-support-card h3 { font-size: 1.2rem; line-height: 1.35; margin: 1rem 0 .65rem; }
.htc-support-card p { margin: 0; line-height: 1.65; }
.htc-support-number { display: inline-flex; padding: .35rem .65rem; border-radius: .65rem; background: #91f8b5; color: #0a0e1a; font-weight: 800; }
.htc-page .htc-section { padding-block: 0 2rem; margin-bottom: 2rem; }
.htc-sidebar { top: 8rem; max-height: calc(100vh - 9rem); }
.htc-page [id] { scroll-margin-top: 8rem; }
.htc-goal-example { display: grid; grid-template-columns: minmax(150px, 230px) minmax(0, 1fr); gap: 1.5rem; align-items: center; margin-top: 1.5rem; padding: 1.25rem; border: 1px solid var(--htc-border); border-radius: 1rem; background: var(--htc-example); }
.htc-goal-example img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: .75rem; }
.htc-goal-example h3 { font-size: 1.2rem; line-height: 1.35; margin: 0 0 .75rem; }
.htc-goal-example p { margin: 0 0 .75rem; line-height: 1.65; }
.htc-goal-example p:last-child { margin-bottom: 0; font-size: .9rem; }
.htc-page .htc-cta { margin-top: 0; }
.htc-cta > p { max-width: 650px; margin: 0 auto 1.5rem; line-height: 1.65; }
html .htc-body .htc-page .btn-primary { background: #4b35c9; color: #ffffff; }
html .htc-body .htc-page .btn-secondary { color: var(--htc-ink); border-color: var(--htc-border); }
.htc-page .btn { white-space: normal; text-align: center; }
.htc-page .htc-how-step { background: #4b35c9; color: #ffffff; }
.htc-how-item { padding-inline: 4.5rem 1.5rem; }
.htc-how-step { left: auto; inset-inline-start: 1.25rem; }
.htc-toc-link { border-left: none; border-inline-start: 2px solid transparent; }
.htc-toc-link.is-active { border-inline-start-color: #6c5ce7; }
.htc-rules-grid { grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }
@media (max-width: 760px) {
    .htc-support-grid, .htc-goal-example { grid-template-columns: 1fr; }
    .htc-goal-example img { max-width: 230px; margin-inline: auto; }
    .htc-page .htc-support { padding-top: 2rem; }
    .htc-support-card { padding: 1.25rem; }
    .htc-hero-actions { flex-direction: column; align-items: stretch; }
    .htc-layout { margin-top: 1.5rem; }
    .htc-how-item { padding-inline: 4.25rem 1rem; }
    .htc-page .htc-cta { padding: 1.5rem 1rem; }
}
@media (prefers-reduced-motion: reduce) {
    .htc-page *, .htc-page *::after { transition: none; scroll-behavior: auto; }
}
