/* Shared layout for the legal pages (Impressum, Datenschutz, Barrierefreiheit).
   Same tokens and nav as the main page. */
:root {
    --bg: #faf9f6;
    --bg-raise: #f1f0ea;
    --line: rgba(20, 19, 15, .12);
    --line-soft: rgba(20, 19, 15, .07);
    --text: #14140f;
    --text-2: #5b5c50;
    --text-3: #96968a;
    --accent: #ea580c;
    --accent-2: #ff2f6e;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0a0a08;
        --bg-raise: #131311;
        --line: rgba(255, 255, 255, .12);
        --line-soft: rgba(255, 255, 255, .07);
        --text: #f6f5f0;
        --text-2: #a6a598;
        --text-3: #6c6b60;
        --accent: #ff7a1a;
        --accent-2: #ff3d78;
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --bg: #0a0a08;
    --bg-raise: #131311;
    --line: rgba(255, 255, 255, .12);
    --line-soft: rgba(255, 255, 255, .07);
    --text: #f6f5f0;
    --text-2: #a6a598;
    --text-3: #6c6b60;
    --accent: #ff7a1a;
    --accent-2: #ff3d78;
    color-scheme: dark;
}

:root[data-theme="light"] {
    --bg: #faf9f6;
    --bg-raise: #f1f0ea;
    --line: rgba(20, 19, 15, .12);
    --line-soft: rgba(20, 19, 15, .07);
    --text: #14140f;
    --text-2: #5b5c50;
    --text-3: #96968a;
    --accent: #ea580c;
    --accent-2: #ff2f6e;
    color-scheme: light;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    transition: background-color .4s ease, color .4s ease;
}

::selection {
    background: var(--accent);
    color: #fff;
}

h1, h2, h3 {
    font-family: 'Space Grotesk', sans-serif;
}

a {
    color: inherit;
    -webkit-tap-highlight-color: transparent;
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

/* Language blocks: the long texts exist once per language */
html:not([lang="en"]) .only-en,
html[lang="en"] .only-de {
    display: none;
}

.skip-link {
    position: absolute;
    top: -100px;
    left: 16px;
    z-index: 10000;
    background: var(--accent);
    color: #fff;
    padding: 10px 18px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: top .2s ease;
}

.skip-link:focus {
    top: 16px;
}

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 100%;
    transform-origin: left;
    transform: scaleX(0);
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    z-index: 200;
}

/* Nav */
.topnav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 26px max(32px, calc((100% - 1180px) / 2 + 32px));
    transition: padding .3s ease, background-color .3s ease, backdrop-filter .3s ease;
}

.topnav.scrolled {
    padding-top: 16px;
    padding-bottom: 16px;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line-soft);
}

.brand {
    display: inline-block;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: -.01em;
    text-decoration: none;
}

.brand .letter,
.brand .dot {
    display: inline-block;
}

.brand .dot {
    /* Square brand dot like in the logos: the font's round period stays as
       invisible text (spacing, copy/paste), a square of the same size sits
       on the baseline in its place */
    color: transparent;
}

.brand .dot::before {
    content: "";
    display: inline-block;
    width: .177em;
    height: .177em;
    margin: 0 -.232em 0 .055em;
    background: var(--accent);
}

.brand:hover .letter {
    animation: letter-hop .5s cubic-bezier(.34, 1.56, .64, 1) both;
    animation-delay: calc(var(--i, 0) * 32ms);
}

.brand:hover .dot {
    animation: dot-hop .6s cubic-bezier(.34, 1.56, .64, 1) both;
    animation-delay: calc(var(--i, 0) * 32ms);
}

@keyframes letter-hop {
    0%, 100% { transform: translateY(0); }
    40% { transform: translateY(-6px); }
}

@keyframes dot-hop {
    0%, 100% { transform: translateY(0) scale(1); }
    35% { transform: translateY(-9px) scale(1.15, .82); }
    62% { transform: translateY(0) scale(.82, 1.18); }
    80% { transform: translateY(-2px) scale(1.05, .96); }
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 22px;
}

.nav-back {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .82rem;
    color: var(--text-3);
    text-decoration: none;
    transition: color .2s ease;
}

.nav-back svg {
    width: 14px;
    height: 14px;
    transition: transform .25s ease;
}

.nav-back:hover {
    color: var(--text);
}

.nav-back:hover svg {
    transform: translateX(-3px);
}

.lang-toggle {
    display: flex;
    align-items: center;
    gap: 2px;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 3px;
}

.lang-btn {
    font-family: inherit;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .02em;
    background: none;
    border: none;
    border-radius: 999px;
    padding: 5px 10px;
    color: var(--text-3);
    cursor: pointer;
    transition: background .2s ease, color .2s ease;
}

.lang-btn:hover {
    color: var(--text);
}

.lang-btn.active {
    background: var(--accent);
    color: #fff;
}

.theme-toggle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: none;
    color: var(--text-2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color .2s ease, color .2s ease, transform .3s ease;
}

.theme-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: rotate(20deg);
}

.theme-toggle svg {
    width: 16px;
    height: 16px;
}

.theme-toggle .icon-moon {
    display: none;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: none; }
    :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: block; }
}

:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

@media (max-width: 560px) {
    .nav-back span { display: none; }
    .nav-right { gap: 14px; }
    .topnav, .topnav.scrolled { padding-left: 16px; padding-right: 16px; }
}

/* Page */
.legal {
    max-width: 1180px;
    margin: 0 auto;
    padding: 150px 32px 100px;
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 72px;
    align-items: start;
}

.legal-head {
    grid-column: 1 / -1;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--line);
}

.eyebrow {
    display: block;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--text-3);
    margin-bottom: 18px;
}

.legal-head h1 {
    font-size: clamp(2.4rem, 6vw, 4.6rem);
    font-weight: 500;
    line-height: 1.02;
    letter-spacing: -.03em;
}

.legal-head h1 .dot {
    /* Square dot (same as the brand): the round period stays as invisible
       text, a square of its size sits on the baseline in its place */
    color: transparent;
}

.legal-head h1 .dot::before {
    content: "";
    display: inline-block;
    width: .163em;
    height: .163em;
    margin: 0 -.219em 0 .056em;
    background: var(--accent);
}

.legal-head .lede {
    margin-top: 18px;
    color: var(--text-2);
    font-size: 1.02rem;
    max-width: 60ch;
    line-height: 1.6;
}

.toc {
    position: sticky;
    top: 100px;
    font-size: .86rem;
}

.toc-title {
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--text-3);
    margin-bottom: 14px;
}

.toc ol {
    list-style: none;
    border-left: 1px solid var(--line);
}

.toc a {
    display: block;
    padding: 7px 0 7px 16px;
    margin-left: -1px;
    border-left: 1px solid transparent;
    color: var(--text-2);
    text-decoration: none;
    line-height: 1.4;
    transition: color .2s ease, border-color .2s ease;
}

.toc a:hover,
.toc a.active {
    color: var(--accent);
    border-left-color: var(--accent);
}

.legal-body {
    max-width: 72ch;
    color: var(--text-2);
    font-size: 1rem;
    line-height: 1.75;
}

.legal-body h2 {
    color: var(--text);
    font-size: clamp(1.35rem, 2.4vw, 1.7rem);
    font-weight: 500;
    letter-spacing: -.01em;
    line-height: 1.25;
    margin: 64px 0 18px;
    scroll-margin-top: 110px;
}

.legal-body h2:first-child {
    margin-top: 0;
}

.legal-body h3 {
    color: var(--text);
    font-size: 1.08rem;
    font-weight: 600;
    margin: 32px 0 10px;
}

.legal-body p + p {
    margin-top: 14px;
}

.legal-body ul {
    margin: 14px 0 0 20px;
}

.legal-body li + li {
    margin-top: 8px;
}

.legal-body li::marker {
    color: var(--accent);
}

.legal-body strong {
    color: var(--text);
    font-weight: 600;
}

.legal-body a {
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px solid var(--line);
    transition: color .2s ease, border-color .2s ease;
    overflow-wrap: anywhere;
}

.legal-body a:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.card {
    margin: 18px 0;
    padding: 24px 28px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--bg-raise);
    color: var(--text);
    font-style: normal;
    line-height: 1.7;
}

.card .label {
    display: block;
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--text-3);
    margin-bottom: 8px;
}

/* Contact form */
.contact-form {
    margin-top: 22px;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--bg-raise);
}

.contact-form .field + .field {
    margin-top: 18px;
}

.contact-form label {
    display: block;
    font-size: .86rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.contact-form .opt {
    font-weight: 400;
    color: var(--text-3);
}

.contact-form .req {
    color: var(--accent);
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    font: inherit;
    font-size: .98rem;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px 14px;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.contact-form textarea {
    resize: vertical;
    min-height: 140px;
    line-height: 1.6;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

.contact-form input:user-invalid,
.contact-form textarea:user-invalid {
    border-color: #e5484d;
}

/* Honeypot: off-screen rather than display:none, so naive bots still see it */
.contact-form .hp {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.form-hint {
    margin-top: 18px;
    font-size: .82rem;
    line-height: 1.6;
    color: var(--text-3);
}

.legal-body .form-hint a {
    color: var(--text-2);
}

.form-submit {
    margin-top: 20px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font: inherit;
    font-weight: 600;
    font-size: .92rem;
    color: #fff;
    background: var(--accent);
    border: none;
    border-radius: 999px;
    padding: 12px 22px;
    cursor: pointer;
    transition: transform .2s ease, opacity .2s ease;
}

.form-submit svg {
    width: 16px;
    height: 16px;
    transition: transform .25s ease;
}

.form-submit:hover svg {
    transform: translateX(3px);
}

.form-submit:disabled {
    opacity: .6;
    cursor: progress;
}

.form-status {
    margin-bottom: 22px;
    padding: 16px 18px;
    border-radius: 12px;
    border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    color: var(--text);
    font-size: .92rem;
    line-height: 1.5;
}

.form-status strong {
    display: block;
}

@media (max-width: 560px) {
    .contact-form {
        padding: 20px;
    }
}

.stand {
    margin-top: 64px;
    padding-top: 24px;
    border-top: 1px solid var(--line-soft);
    font-size: .86rem;
    color: var(--text-3);
}

@media (max-width: 900px) {
    .legal {
        grid-template-columns: 1fr;
        gap: 40px;
        padding: 120px 16px 72px;
    }

    .toc {
        position: static;
    }
}

/* Footer (same as main page) */
.site-footer {
    padding: 40px 16px 70px;
    text-align: center;
    color: var(--text-3);
    font-size: .82rem;
    border-top: 1px solid var(--line-soft);
}

.site-footer p + p {
    margin-top: 8px;
}

.site-footer .footer-note {
    font-size: .74rem;
    max-width: 60ch;
    margin-left: auto;
    margin-right: auto;
}

.site-footer a {
    color: var(--text-2);
    text-decoration: none;
    border-bottom: 1px solid var(--line);
}

.site-footer a:hover,
.site-footer a[aria-current="page"] {
    color: var(--accent);
    border-color: var(--accent);
}

@media (prefers-reduced-motion: reduce) {
    *:not(.brand .letter):not(.brand .dot),
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}
