/* =========================================================
   ════════  V5.1 — LIQUID EDITORIAL  ════════
   Neue Komposition: Titelblatt-Hero, Editorial-About,
   Periodensystem, Split-View-Kartendeck, Brief + Holo-Karte,
   Nav-Pille, Secret-Sammlung, Taschenlampe
   ========================================================= */

/* ---------------------------------------------------------
   0) GRUNDLAGEN — kein versehentliches Markieren auf UI
   (Fliesstext, Formular und Mailadresse bleiben markierbar)
   --------------------------------------------------------- */
.hero, nav, .section-header, .section-ghost, .stats-rail, .ptable, .ptable-head,
.build, .wk-side, .proj-media, .proj-top, .project-tags, .tech-marquee,
.footer-giant, .footer-marquee, .holo-top, .holo-id, .holo-mail, .btn, .social-links,
.cmdk-list, .cs-head, .scroll-badge, .to-top, .letter-head, .letter-foot, .facts i,
.facts span, .section-rail, .mobile-menu {
    -webkit-user-select: none;
    user-select: none;
}
.hero-sub, input, textarea { -webkit-user-select: text; user-select: text; }
button, a, .el, .stat-tile, .wk-item { -webkit-tap-highlight-color: transparent; }
.hero, .contact { -webkit-touch-callout: none; }

/* Kategorie-Farben (Periodensystem) */
[data-cat="core"]      { --c: 99, 102, 241; }
[data-cat="scripting"] { --c: 167, 139, 250; }
[data-cat="framework"] { --c: 56, 189, 248; }
[data-cat="language"]  { --c: 59, 130, 246; }
[data-cat="backend"]   { --c: 217, 70, 239; }
[data-cat="database"]  { --c: 236, 72, 153; }
[data-cat="ops"]       { --c: 20, 184, 166; }
[data-cat="design"]    { --c: 244, 114, 182; }
[data-cat="tooling"]   { --c: 168, 85, 247; }

/* ---------------------------------------------------------
   1) NAV — schwebende Pille
   --------------------------------------------------------- */
@media (min-width: 769px) {
    nav, nav.scrolled {
        background: transparent;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
        border-bottom-color: transparent;
    }
    [data-theme="light"] nav { background: transparent; }
    .logo, .nav-menu, .nav-actions {
        background: rgba(13, 17, 42, 0.58);
        border: 1px solid var(--border);
        -webkit-backdrop-filter: blur(16px) saturate(160%);
        backdrop-filter: blur(16px) saturate(160%);
        box-shadow: 0 12px 34px -16px rgba(0, 0, 0, 0.6);
    }
    [data-theme="light"] .logo,
    [data-theme="light"] .nav-menu,
    [data-theme="light"] .nav-actions { background: rgba(255, 255, 255, 0.72); box-shadow: 0 12px 34px -18px rgba(31, 28, 79, 0.3); }
    .logo { padding: 0.45rem 0.85rem; border-radius: 14px; }
    .nav-actions { padding: 5px; border-radius: 100px; gap: 0.4rem; }
    .nav-actions .cmdk-btn, .nav-actions .theme-toggle { border-color: transparent; }
    .nav-menu {
        position: relative;
        gap: 0;
        padding: 5px;
        border-radius: 100px;
    }
    .nav-link {
        position: relative;
        z-index: 1;
        padding: 0.5rem 0.95rem;
        border-radius: 100px;
    }
    .nav-link::after { display: none; }
    .nav-pill {
        position: absolute;
        top: 5px;
        bottom: 5px;
        left: 0;
        z-index: 0;
        width: 0;
        border-radius: 100px;
        background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(236, 72, 153, 0.22));
        border: 1px solid rgba(139, 92, 246, 0.4);
        box-shadow: 0 0 18px rgba(139, 92, 246, 0.25);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.55s cubic-bezier(0.65, 0, 0.05, 1), width 0.55s cubic-bezier(0.65, 0, 0.05, 1), opacity 0.3s ease;
    }
    .nav-roll {
        position: relative;
        display: inline-block;
        height: 1.3em;
        line-height: 1.3em;
        overflow: hidden;
        vertical-align: bottom;
    }
    .nav-roll > span { display: block; transition: transform 0.45s var(--ease); }
    .nav-roll::after {
        content: attr(data-t);
        position: absolute;
        left: 0;
        top: 100%;
        color: var(--text-primary);
        transition: transform 0.45s var(--ease);
    }
    .nav-link:hover .nav-roll > span,
    .nav-link:hover .nav-roll::after { transform: translateY(-100%); }
}

/* ---------------------------------------------------------
   2) HERO — Titelblatt
   --------------------------------------------------------- */
.hero-v2 { padding-top: 7.2rem; padding-bottom: 2.4rem; }
.hero-v2 .hero-inner { gap: 0; }
.hero-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.hero-coords {
    display: flex;
    align-items: center;
    gap: 1rem;
    font: 500 0.7rem var(--font-mono);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.hero-coords b {
    font-weight: 500;
    color: var(--text-secondary);
    padding-left: 1rem;
    border-left: 1px solid var(--border-strong);
}
.hero-coords b::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 0.5rem;
    border-radius: 50%;
    background: var(--accent-lighter);
    box-shadow: 0 0 8px var(--accent-lighter);
    vertical-align: 1px;
    animation: blink 2s ease-in-out infinite;
}

.hero-name {
    --nameFs: min(14.2vw, 26vh, 15rem);
    position: relative;
    margin: 1.4rem 0 0.4rem;
}
.hero-v2 .hero-title.kinetic {
    display: flex;
    flex-direction: column;
    font-size: var(--nameFs);
    line-height: 0.88;
    letter-spacing: -0.045em;
}
.hero-v2 .kinetic-line.l2 { align-self: flex-end; margin-top: -0.04em; }
.hero-statement {
    position: absolute;
    left: 0;
    bottom: calc(var(--nameFs) * 0.1);
    width: max(14rem, calc(100% - var(--nameFs) * 3.7 - 2.5rem));
    max-width: 30rem;
}
.hero-v2 .hero-tagline {
    margin: 0 0 0.55rem;
    font-size: clamp(1.15rem, 1.8vw, 1.6rem);
}
.hero-sub {
    margin: 0;
    max-width: 34ch;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.hero-bottom {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
    margin-top: 1.6rem;
}
.hero-actions { display: flex; align-items: center; gap: 1.6rem; }
.hero-v2 .hero-cta { margin: 0; }

/* Rotierendes Scroll-Badge (ersetzt die Linie) */
.hero-scroll.scroll-badge {
    position: relative;
    right: auto;
    bottom: auto;
    flex: 0 0 auto;
    width: 92px;
    height: 92px;
    display: grid;
    place-items: center;
    gap: 0;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: rgba(13, 17, 42, 0.4);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    color: var(--text-secondary);
    letter-spacing: normal;
    transition: border-color 0.3s ease, color 0.3s ease;
}
.scroll-badge svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    animation: badgeSpin 16s linear infinite;
}
.scroll-badge text {
    font: 600 7.6px var(--font-mono);
    fill: currentColor;
}
.hero-scroll.scroll-badge i {
    width: auto;
    height: auto;
    background: none;
    overflow: visible;
    font-size: 0.85rem;
    color: var(--accent-lighter);
    transition: transform 0.45s var(--ease);
}
.hero-scroll.scroll-badge i::after { display: none; }
.scroll-badge:hover { border-color: var(--accent); color: var(--text-primary); }
.scroll-badge:hover i { transform: translateY(5px); }
.scroll-badge:hover svg { animation-duration: 5s; }
@keyframes badgeSpin { to { transform: rotate(360deg); } }
[data-theme="light"] .hero-scroll.scroll-badge { background: rgba(255, 255, 255, 0.55); }

/* Terminal-/Identity-Karte (enthält die Meta-Infos) */
.id-card.hero-meta {
    position: relative;
    display: block;
    width: min(370px, 100%);
    margin: 0;
    padding: 0;
    border: 1px solid var(--border-strong);
    border-radius: 16px;
    background: rgba(9, 12, 32, 0.74);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.8), 0 0 50px rgba(99, 102, 241, 0.12);
    font-family: var(--font-mono);
    overflow: hidden;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.id-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(240px circle at calc((var(--tx, 0) + 0.5) * 100%) calc((var(--ty, 0) + 0.5) * 100%), rgba(139, 92, 246, 0.2), transparent 65%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.id-card.tilting::before { opacity: 1; }
.id-card:hover { border-color: rgba(236, 72, 153, 0.5); box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.8), 0 0 60px rgba(236, 72, 153, 0.16); }
.id-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0.6rem 0.9rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.64rem;
    color: var(--text-muted);
}
.id-bar i { width: 9px; height: 9px; border-radius: 50%; background: #FF5F57; }
.id-bar i:nth-child(2) { background: #FEBC2E; }
.id-bar i:nth-child(3) { background: #28C840; }
.id-bar span { margin-left: 0.5rem; }
.id-lines { display: grid; gap: 0.5rem; margin: 0; padding: 0.85rem 1rem 0.35rem; }
.id-line dt { font-size: 0.66rem; letter-spacing: 0.04em; color: var(--text-muted); }
.id-line dt b { color: var(--accent-lighter); font-weight: 600; }
.id-line dd {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0.12rem 0 0;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    color: var(--text-primary);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    clip-path: inset(0 100% 0 0);
    animation: idType 0.7s steps(22, end) both;
    animation-delay: calc(1.5s + var(--n, 0) * 0.38s);
    animation-play-state: paused;
}
body.ready .id-line dd { animation-play-state: running; }
@keyframes idType { to { clip-path: inset(0 0 0 0); } }
.id-prompt { padding: 0.25rem 1rem 0.9rem; font-size: 0.72rem; color: var(--text-muted); }
.id-prompt b { color: var(--accent-lighter); }
.id-caret {
    display: inline-block;
    width: 0.5em;
    height: 1em;
    vertical-align: text-bottom;
    background: var(--accent-lighter);
    animation: caretBlink 1s steps(1) infinite;
}
[data-theme="light"] .id-card.hero-meta { background: rgba(255, 255, 255, 0.8); box-shadow: 0 30px 70px -36px rgba(31, 28, 79, 0.35); }

/* Entrance der neuen Hero-Bausteine */
.hero-coords, .hero-sub {
    animation: fadeUp 0.9s var(--ease) both;
    animation-play-state: paused;
}
.hero-coords { animation-delay: 0.25s; }
.hero-sub { animation-delay: 0.95s; }
body.ready .hero-coords, body.ready .hero-sub { animation-play-state: running; }

/* Name driftet beim Rausscrollen auseinander */
@supports (animation-timeline: scroll()) {
    @media (prefers-reduced-motion: no-preference) {
        .hero-v2 .kinetic-line.l1 {
            animation: splitL linear both;
            animation-timeline: scroll(root);
            animation-range: 0 90vh;
        }
        .hero-v2 .kinetic-line.l2 {
            animation: splitR linear both;
            animation-timeline: scroll(root);
            animation-range: 0 90vh;
        }
        @keyframes splitL { to { translate: -14vw 0; } }
        @keyframes splitR { to { translate: 14vw 0; } }
    }
}

/* Fokus-Modus des Partikel-Secrets: Inhalt tritt zurück */
.hero-inner > *, .contact > .container > * { transition: opacity 0.6s ease; }
.hero.net-focus .hero-inner > * { opacity: 0.14; }
.contact.net-focus > .container > * { opacity: 0.14; }
body:has(.net-focus) .cursor-dot {
    box-shadow: 0 0 0 10px rgba(236, 72, 153, 0.14), 0 0 0 24px rgba(139, 92, 246, 0.08), 0 0 24px rgba(236, 72, 153, 0.6);
}
.net-progress { font-size: 0.8rem; padding: 0.5rem 1.1rem; border-color: var(--border-strong); }

/* ---------------------------------------------------------
   3) ABOUT — Editorial
   --------------------------------------------------------- */
.about-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: 4.5rem;
    align-items: start;
    margin-bottom: 4.5rem;
}
.about-left { position: sticky; top: 7.5rem; }
.about-v2 .about-quote {
    grid-column: auto;
    max-width: none;
    padding: 0;
    border-bottom: none;
    font-size: clamp(1.7rem, 2.9vw, 2.65rem);
    line-height: 1.22;
}
.about-sign {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1.4rem;
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 1.7rem;
    color: var(--accent-light);
}
.about-sign i {
    flex: 1;
    max-width: 180px;
    height: 1px;
    background: linear-gradient(90deg, var(--accent), transparent);
}
.facts {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
    margin: 2.2rem 0 0;
    padding: 0;
}
.fact {
    position: relative;
    display: grid;
    grid-template-columns: 2.4rem minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 0.8rem;
    align-items: center;
    padding: 0.8rem 0.95rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: color-mix(in srgb, var(--surface) 72%, transparent);
    overflow: hidden;
    transition: border-color 0.3s ease, transform 0.45s var(--ease), background 0.3s ease;
}
.fact > i {
    grid-row: 1 / 3;
    display: grid;
    place-items: center;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 10px;
    background: rgba(99, 102, 241, 0.12);
    color: var(--accent-light);
    font-size: 0.95rem;
    transition: transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s ease, color 0.3s ease;
}
.fact span {
    font: 500 0.64rem var(--font-mono);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.fact b { min-width: 0; font-size: 0.92rem; font-weight: 500; color: var(--text-primary); }
.fact::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.07) 50%, transparent 65%);
    transform: translateX(-110%);
    transition: transform 0.8s var(--ease);
    pointer-events: none;
}
.fact:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.fact:hover > i { transform: rotate(-10deg) scale(1.12); background: var(--accent-gradient); color: #fff; }
.fact:hover::after { transform: translateX(110%); }

/* Stat-Kacheln */
.stats-rail { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.stat-tile {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-height: 212px;
    padding: 1.45rem 1.35rem 1.15rem;
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
}
.stat-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.st-num {
    margin-bottom: 0.85rem;
    font-family: var(--font-display);
    font-size: 3.1rem;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: 0 100%;
}
.st-num small { font-size: 0.5em; }
.st-label { font: 600 1rem var(--font-display); color: var(--text-primary); }
.st-sub { font: 0.76rem var(--font-mono); color: var(--text-muted); transition: color 0.3s ease; }
.stat-tile:hover .st-num { transform: scale(1.06) rotate(-2deg); }
.stat-tile.pop { animation: statPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes statPop { 40% { scale: 0.96; } 75% { scale: 1.02; } }
.stat-tile.wink .st-sub { color: var(--accent-lighter); }
.st-viz {
    display: flex;
    align-items: flex-end;
    height: 44px;
    margin-top: auto;
    padding-top: 0.9rem;
}
/* Jahr 3 von 4 */
.st-years { gap: 6px; position: relative; }
.st-years i {
    flex: 1;
    height: 8px;
    border-radius: 4px;
    background: var(--border);
    position: relative;
    overflow: hidden;
}
.st-years i::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent-gradient);
    opacity: 0.35;
    transform-origin: left;
}
.st-years i:nth-child(4)::after { display: none; }
.st-years i:nth-child(4) { background: transparent; border: 1px dashed var(--border-strong); }
.st-years em {
    position: absolute;
    left: 0;
    bottom: 16px;
    font: normal 0.64rem var(--font-mono);
    letter-spacing: 0.1em;
    color: var(--accent-lighter);
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.3s ease, transform 0.4s var(--ease);
}
.stat-tile:is(:hover, .show) .st-years i::after { opacity: 1; animation: barFill 0.55s var(--ease) both; }
.stat-tile:is(:hover, .show) .st-years i:nth-child(2)::after { animation-delay: 0.1s; }
.stat-tile:is(:hover, .show) .st-years i:nth-child(3)::after { animation-delay: 0.2s; }
.stat-tile:is(:hover, .show) .st-years em { opacity: 1; transform: none; }
@keyframes barFill { from { transform: scaleX(0); } }
/* 6 Projekte */
.st-proj { gap: 6px; }
.st-proj i {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 7px;
    font: normal 600 0.7rem var(--font-display);
    color: transparent;
    background: rgba(99, 102, 241, 0.16);
    border: 1px solid var(--border);
    transform: scale(0.45);
    transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.3s ease, background 0.3s ease;
}
.st-proj i:nth-child(1) { transition-delay: 0s; }
.st-proj i:nth-child(2) { transition-delay: 0.05s; }
.st-proj i:nth-child(3) { transition-delay: 0.1s; }
.st-proj i:nth-child(4) { transition-delay: 0.15s; }
.st-proj i:nth-child(5) { transition-delay: 0.2s; }
.st-proj i:nth-child(6) { transition-delay: 0.25s; }
.stat-tile:is(:hover, .show) .st-proj i { transform: none; color: #fff; background: linear-gradient(135deg, rgba(99, 102, 241, 0.85), rgba(236, 72, 153, 0.7)); }
.stat-tile:is(:hover, .show) .st-proj i:nth-child(1) { background: linear-gradient(135deg, #3B82F6, #8B5CF6); }
/* AI-Netz */
.st-ai svg, .st-ecg svg { width: 100%; height: 100%; overflow: visible; }
.st-edges path {
    fill: none;
    stroke: rgba(139, 92, 246, 0.35);
    stroke-width: 1.2;
    stroke-dasharray: 420;
    stroke-dashoffset: 0;
}
.st-nodes circle { fill: var(--accent-light); transform-box: fill-box; transform-origin: center; transition: fill 0.3s ease; }
.stat-tile:is(:hover, .show) .st-edges path { stroke: rgba(236, 72, 153, 0.7); animation: edgeDraw 1.1s var(--ease) both; }
.stat-tile:is(:hover, .show) .st-nodes circle { fill: #F472B6; animation: nodePulse 1.2s ease-in-out infinite; }
.stat-tile:is(:hover, .show) .st-nodes circle:nth-child(2n) { animation-delay: 0.3s; }
.stat-tile:is(:hover, .show) .st-nodes circle:nth-child(3n) { animation-delay: 0.6s; }
@keyframes edgeDraw { from { stroke-dashoffset: 420; } }
@keyframes nodePulse { 50% { transform: scale(1.5); } }
/* Herzschlag */
.st-ecg path {
    fill: none;
    stroke: rgba(139, 92, 246, 0.4);
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 260;
}
.stat-tile:is(:hover, .show) .st-ecg path { stroke: #F472B6; animation: ecgDraw 1.4s linear infinite; filter: drop-shadow(0 0 4px rgba(236, 72, 153, 0.7)); }
@keyframes ecgDraw { from { stroke-dashoffset: 260; } to { stroke-dashoffset: -260; } }
:where(.el):hover .card-glow { opacity: 1; }

/* ---------------------------------------------------------
   4) STACK — Periodensystem
   --------------------------------------------------------- */
.ptable-head {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: end;
    gap: 1rem 2rem;
    margin: 0.5rem 0 1.8rem;
}
.ptable-title { margin: 0; font-size: clamp(1.6rem, 3vw, 2.4rem); }
.ptable-hint {
    margin: 0;
    font: 0.7rem var(--font-mono);
    letter-spacing: 0.08em;
    color: var(--text-muted);
    text-align: right;
}
.ptable-hint i { color: var(--accent-lighter); margin-right: 0.3rem; }
.ptable-legend {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    list-style: none;
    margin: 0;
    padding: 0;
}
.ptable-legend button {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.75rem;
    font: 500 0.66rem var(--font-mono);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 100px;
    cursor: pointer;
    transition: border-color 0.25s ease, color 0.25s ease, background 0.25s ease;
}
.ptable-legend button i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgb(var(--c));
    box-shadow: 0 0 8px rgba(var(--c), 0.7);
}
.ptable-legend button:hover, .ptable-legend button.on {
    color: var(--text-primary);
    border-color: rgba(var(--c), 0.65);
    background: rgba(var(--c), 0.12);
}
.ptable {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.8rem;
    margin-bottom: 3.5rem;
    perspective: 1400px;
}
.el {
    position: relative;
    aspect-ratio: 1 / 1.08;
    padding: 0;
    font: inherit;
    color: inherit;
    text-align: left;
    background: none;
    border: 0;
    border-radius: 14px;
    cursor: pointer;
    perspective: 900px;
    transition: transform 0.45s var(--ease), filter 0.35s ease;
}
.el:focus-visible { outline: 2px solid rgb(var(--c)); outline-offset: 3px; }
.el-inner {
    position: absolute;
    inset: 0;
    display: block;
    transform-style: preserve-3d;
    transform: rotateY(calc(var(--flip, 0) * 180deg + var(--tx, 0) * 16deg)) rotateX(calc(var(--ty, 0) * -16deg));
    transition: transform 0.75s cubic-bezier(0.3, 1.25, 0.4, 1);
}
.el.flipped { --flip: 1; }
.el-face {
    position: absolute;
    inset: 0;
    display: block;
    padding: 0.8rem 0.85rem;
    border-radius: 14px;
    border: 1px solid rgba(var(--c), 0.3);
    background: linear-gradient(160deg, rgba(var(--c), 0.17), rgba(var(--c), 0.03) 58%), var(--surface-elev);
    overflow: hidden;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.el-back {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    transform: rotateY(180deg);
    background: linear-gradient(160deg, rgba(var(--c), 0.32), rgba(var(--c), 0.08)), var(--surface-elev);
}
.el-no { font: 500 0.66rem var(--font-mono); color: rgb(var(--c)); }
.el-lvl { position: absolute; top: 0.95rem; right: 0.85rem; display: flex; gap: 3px; }
.el-lvl i { width: 5px; height: 5px; border-radius: 50%; background: rgba(var(--c), 0.22); }
.el-lvl i.on { background: rgb(var(--c)); box-shadow: 0 0 6px rgba(var(--c), 0.85); }
.el-sym {
    position: absolute;
    left: 0.8rem;
    top: 26%;
    font: 700 clamp(2.1rem, 3.5vw, 3.3rem) / 1 var(--font-display);
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #fff 15%, rgb(var(--c)) 120%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: 0 50%;
}
[data-theme="light"] .el-sym { background-image: linear-gradient(135deg, var(--text-primary) 20%, rgb(var(--c)) 110%); }
.el-name {
    position: absolute;
    left: 0.85rem;
    right: 2.2rem;
    bottom: 1.95rem;
    font: 600 0.86rem var(--font-display);
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.el-cat {
    position: absolute;
    left: 0.85rem;
    bottom: 0.8rem;
    font: 0.56rem var(--font-mono);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(var(--c), 0.95);
}
.el-icon {
    position: absolute;
    right: 0.85rem;
    bottom: 0.8rem;
    font-size: 1rem;
    color: rgba(var(--c), 0.85);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.el:hover { transform: translateY(-4px); }
.el:hover .el-face {
    border-color: rgba(var(--c), 0.75);
    box-shadow: 0 18px 40px -18px rgba(var(--c), 0.65), inset 0 0 30px rgba(var(--c), 0.12);
}
.el:hover .el-sym { transform: scale(1.08); }
.el:hover .el-icon { transform: rotate(-14deg) scale(1.25); }
.el-desc { font-size: 0.74rem; line-height: 1.45; color: var(--text-primary); }
.el-used, .el-level {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    font: 0.66rem var(--font-mono);
    color: var(--text-secondary);
}
.el-used small, .el-level small {
    font-size: 0.54rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgb(var(--c));
}
.el-level { display: none; }
.el.dim { filter: saturate(0.25) brightness(0.6); }
.el.hl .el-face { border-color: rgba(var(--c), 0.85); box-shadow: 0 0 0 1px rgba(var(--c), 0.5), 0 14px 40px -16px rgba(var(--c), 0.8); }
@supports (animation-timeline: view()) {
    @media (prefers-reduced-motion: no-preference) {
        .ptable .el {
            animation: stackAssemble linear both;
            animation-timeline: view();
            animation-range: entry 0% cover 26%;
        }
    }
}

/* ---------------------------------------------------------
   5) WORK — Liste/Karten (Mobile) & Kartendeck (Desktop)
   --------------------------------------------------------- */
.work-v2 .wk-grid { display: block; }
.work-v2 .wk-side .section-header { margin-bottom: 2.5rem; }
.work-v2 .wk-list, .work-v2 .wk-index { display: none; }
.work-v2 .wk-deck {
    display: grid;
    gap: 1.6rem;
    max-width: 720px;
    margin: 0 auto;
}
.proj {
    position: relative;
    display: block;
    border-radius: 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    overflow: hidden;
}
.proj-media {
    position: relative;
    display: block;
    background: var(--surface-elev);
}
.proj-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 0.85rem;
    background: rgba(9, 12, 32, 0.92);
    border-bottom: 1px solid var(--border);
    font: 0.62rem var(--font-mono);
    color: var(--text-muted);
}
.proj-bar i { width: 8px; height: 8px; border-radius: 50%; background: #FF5F57; flex: 0 0 auto; }
.proj-bar i:nth-child(2) { background: #FEBC2E; }
.proj-bar i:nth-child(3) { background: #28C840; }
.proj-bar span {
    flex: 1;
    min-width: 0;
    margin: 0 0.6rem;
    padding: 0.18rem 0.6rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.proj-bar b { font-weight: 500; color: var(--text-secondary); transition: transform 0.4s var(--ease); }
.proj-media:hover .proj-bar b { transform: translate(2px, -2px); color: var(--accent-lighter); }
.proj-shot { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: #0b0e22; }
.proj-shot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.9s var(--ease), filter 0.6s ease;
}
.proj-media:hover .proj-shot img { transform: scale(1.04); }
.proj-info { display: flex; flex-direction: column; gap: 0.7rem; padding: 1.3rem 1.35rem 1.45rem; }
.proj-top {
    display: flex;
    justify-content: space-between;
    font: 0.68rem var(--font-mono);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.proj-info h3 { margin: 0; font-size: 1.3rem; }
.proj-info p { margin: 0; font-size: 0.9rem; line-height: 1.6; color: var(--text-secondary); }
.proj-info .project-tags span { transition: transform 0.35s var(--ease), border-color 0.3s ease, color 0.3s ease; }
.proj-info .project-tags span:hover { transform: translateY(-2px); border-color: var(--border-strong); color: var(--text-primary); }
.proj-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    align-self: flex-start;
    font: 0.74rem var(--font-mono);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
}
.proj-cta i { font-size: 0.7rem; transition: transform 0.4s var(--ease); }
.proj-cta:hover i { transform: translate(3px, -3px); }
.lens-on > .lens-canvas { opacity: 1; }

/* Mobile/Tablet: Karten stapeln sich (sticky) */
.projects.stacking .proj {
    position: sticky;
    top: var(--stick, 80px);
    transform-origin: 50% 0;
    scale: calc(1 - var(--cover, 0) * 0.06);
}
.projects.stacking .proj::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 8;
    border-radius: inherit;
    background: var(--primary);
    opacity: calc(var(--cover, 0) * 0.55);
    pointer-events: none;
}

/* Desktop: gepinntes Split-View mit 3D-Kartendeck */
.work-v2.deck-on { padding: 0; }
.work-v2.deck-on .container { animation: none; }
.deck-on .wk { position: relative; }
.deck-on .wk-sticky {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100svh;
    display: flex;
    align-items: stretch;
    padding: 5.6rem 0 2.2rem;
    overflow: hidden;
}
.deck-on .wk-grid {
    display: grid;
    grid-template-columns: minmax(240px, 0.62fr) minmax(0, 1.5fr);
    gap: 3.5rem;
    width: 100%;
    height: 100%;
}
.deck-on .wk-side { display: flex; flex-direction: column; min-height: 0; }
.deck-on .wk-side .section-header { margin-bottom: 1.6rem; }
.deck-on .wk-side .section-title { font-size: clamp(1.9rem, 2.6vw, 2.7rem); }
.deck-on .wk-list {
    display: flex;
    flex-direction: column;
    list-style: none;
    margin: 0;
    padding: 0;
}
.wk-item {
    position: relative;
    display: grid;
    grid-template-columns: 2.1rem 1fr auto;
    align-items: baseline;
    gap: 0.4rem;
    width: 100%;
    padding: 0.6rem 0.2rem 0.6rem 0.95rem;
    font: inherit;
    text-align: left;
    color: var(--text-muted);
    background: none;
    border: 0;
    border-left: 1px solid var(--border);
    cursor: pointer;
    transition: color 0.3s ease, padding 0.45s var(--ease);
}
.wk-item span { font: 0.66rem var(--font-mono); transition: color 0.3s ease; }
.wk-item b { font: 600 1.05rem var(--font-display); color: inherit; }
.wk-item em { font: normal 0.66rem var(--font-mono); letter-spacing: 0.08em; }
.wk-item::before {
    content: '';
    position: absolute;
    left: -1px;
    top: 16%;
    bottom: 16%;
    width: 2px;
    background: linear-gradient(to bottom, var(--accent), var(--proj, var(--accent-lighter)));
    box-shadow: 0 0 10px rgba(var(--proj-rgb), 0.85);
    transform: scaleY(0);
    transition: transform 0.45s var(--ease);
}
.wk-item:hover { color: var(--text-secondary); padding-left: 1.2rem; }
.wk-item.on { color: var(--text-primary); padding-left: 1.35rem; }
.wk-item.on::before { transform: scaleY(1); }
.wk-item.on span { color: rgb(var(--proj-rgb)); }
.wk-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 6px; }
.deck-on .wk-index {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    height: 1em;
    margin-top: auto;
    overflow: hidden;
    font: 700 clamp(4.5rem, 8.5vw, 8rem) / 1 var(--font-display);
    letter-spacing: -0.05em;
    color: transparent;
    -webkit-text-stroke: 1.5px rgba(var(--proj-rgb), 0.6);
    transition: -webkit-text-stroke-color 0.8s ease;
}
.wk-index small {
    align-self: flex-end;
    padding-bottom: 0.25em;
    font: 500 0.85rem var(--font-mono);
    letter-spacing: 0.1em;
    color: var(--text-muted);
    -webkit-text-stroke: 0;
}
.deck-on .wk-deck {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    grid-template-areas: "deck" "info";
    gap: 1.4rem;
    max-width: none;
    margin: 0;
    min-height: 0;
    perspective: 2200px;
    perspective-origin: 50% 0%;
}
.deck-on .proj { display: contents; }
.deck-on .proj-media {
    grid-area: deck;
    align-self: center;
    justify-self: center;
    width: min(100%, calc((100svh - 24.8rem) * 1.778));
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    box-shadow: 0 50px 100px -40px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.03);
    transform-origin: 50% 100%;
    transform:
        translate3d(calc(var(--dp, 0) * 3.4%), calc(var(--dp, 0) * -5% + var(--dn, 0) * 125%), calc(var(--dp, 0) * -110px))
        rotateX(calc(var(--dn, 0) * -24deg))
        rotateZ(calc(var(--dn, 0) * 6deg))
        scale(calc(1 - var(--dp, 0) * 0.06));
    /* weggeflogene Karten blenden erst ab 30 % Weg aus → kein Durchscheinen */
    opacity: clamp(0, calc(1 - var(--dp, 0) * 0.32 + min(0, var(--dn, 0) + 0.3) * 1.8), 1);
    will-change: transform, opacity;
}
.deck-on .proj:not(.is-active) .proj-media { pointer-events: none; }
.deck-on .proj.is-active .proj-media { border-color: rgba(var(--proj-rgb), 0.55); box-shadow: 0 50px 100px -40px rgba(0, 0, 0, 0.85), 0 0 60px -10px rgba(var(--proj-rgb), 0.35); }
.deck-on .proj-info {
    grid-area: info;
    max-width: 760px;
    padding: 0;
    gap: 0.6rem;
    visibility: hidden;
    pointer-events: none;
}
.deck-on .proj-info > * {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.3s ease, transform 0.4s var(--ease);
}
.deck-on .proj.is-active .proj-info { visibility: visible; pointer-events: auto; }
.deck-on .proj.is-active .proj-info > * { opacity: 1; transform: none; transition: opacity 0.5s ease, transform 0.7s var(--ease); }
.deck-on .proj.is-active .proj-info > :nth-child(1) { transition-delay: 0.08s; }
.deck-on .proj.is-active .proj-info > :nth-child(2) { transition-delay: 0.14s; }
.deck-on .proj.is-active .proj-info > :nth-child(3) { transition-delay: 0.2s; }
.deck-on .proj.is-active .proj-info > :nth-child(4) { transition-delay: 0.26s; }
.deck-on .proj.is-active .proj-info > :nth-child(5) { transition-delay: 0.32s; }
.deck-on .proj-info h3 { font-size: clamp(1.4rem, 2vw, 1.8rem); }
.deck-on .proj-info p { max-width: 64ch; }
.deck-on .project-tags { margin-top: 0.1rem; }
@media (max-height: 820px) {
    .deck-on .wk-sticky { padding: 5rem 0 1.6rem; }
    .deck-on .wk-item { padding-top: 0.45rem; padding-bottom: 0.45rem; }
}

/* ---------------------------------------------------------
   6) KONTAKT — Brief + Holo-Visitenkarte
   --------------------------------------------------------- */
.contact-v2 .contact-hero {
    display: block;
    margin-bottom: 3rem;
    padding-bottom: 0;
    border-bottom: none;
}
.contact-v2 .contact-mega { max-width: none; font-size: clamp(2.3rem, 5.6vw, 5.2rem); }
.ct-grid {
    display: grid;
    grid-template-columns: minmax(300px, 0.8fr) minmax(0, 1.35fr);
    gap: 3rem;
    align-items: start;
}
.holo { display: flex; flex-direction: column; gap: 1rem; }
.holo-card {
    --hx: 0.5;
    --hy: 0.5;
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: 1.6rem 1.6rem 1.45rem;
    border-radius: 22px;
    color: #F5F7FF;
    background: linear-gradient(135deg, #1c2050 0%, #13163a 46%, #2b1442 100%);
    border: 1px solid rgba(139, 92, 246, 0.42);
    box-shadow: 0 40px 80px -32px rgba(0, 0, 0, 0.8), 0 0 60px rgba(99, 102, 241, 0.16);
    transform: perspective(1000px) rotateY(calc((var(--hx) - 0.5) * 14deg)) rotateX(calc((0.5 - var(--hy)) * 10deg));
    transition: transform 0.6s var(--ease), box-shadow 0.4s ease;
}
.holo-card.tilting { transition: transform 0.15s ease-out, box-shadow 0.4s ease; box-shadow: 0 50px 90px -32px rgba(0, 0, 0, 0.85), 0 0 80px rgba(236, 72, 153, 0.2); }
.holo-shine {
    position: absolute;
    inset: -45%;
    z-index: 0;
    pointer-events: none;
    background: conic-gradient(from calc(var(--hx) * 300deg) at calc(var(--hx) * 100%) calc(var(--hy) * 100%),
        rgba(99, 102, 241, 0), rgba(236, 72, 153, 0.28), rgba(56, 189, 248, 0.22), rgba(139, 92, 246, 0.3), rgba(16, 185, 129, 0.16), rgba(99, 102, 241, 0));
    mix-blend-mode: color-dodge;
    opacity: 0.5;
    filter: blur(16px);
}
.holo-card:not(.tilting) .holo-shine { animation: holoDrift 11s ease-in-out infinite; }
@keyframes holoDrift { 50% { transform: rotate(25deg) translate(6%, -4%); } }
.holo-grain {
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: 0.08;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 120 120' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.holo-card > :not(.holo-shine):not(.holo-grain) { position: relative; z-index: 1; }
.holo-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.holo-logo {
    font: 800 1.7rem var(--font-display);
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.holo-chip {
    display: grid;
    grid-template-rows: repeat(3, 1fr);
    gap: 3px;
    width: 42px;
    height: 32px;
    padding: 6px 7px;
    border-radius: 7px;
    background: linear-gradient(135deg, #e3c37a, #8a6d2c);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}
.holo-chip i { border-top: 1px solid rgba(60, 40, 10, 0.5); }
.holo-name { display: block; font: 700 1.55rem var(--font-display); letter-spacing: -0.01em; }
.holo-role { font: 0.7rem var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: #B9C0DE; }
.holo-mail {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    margin: 1.3rem 0 1.15rem;
    padding: 0.8rem 1rem;
    font: 500 0.95rem var(--font-mono);
    color: #F5F7FF;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.3s ease, border-color 0.3s ease;
}
.holo-mail:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(236, 72, 153, 0.6); }
.holo-mail.copied { background: rgba(16, 185, 129, 0.14); border-color: rgba(16, 185, 129, 0.75); }
.hm-ic { font-size: 0.9rem; color: #B9C0DE; transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.3s ease; }
.holo-mail:hover .hm-ic { transform: scale(1.15) rotate(-8deg); color: #fff; }
.holo-mail.copied .hm-ic { color: #34D399; }
.holo-meta { display: grid; gap: 0.7rem; margin: 0 0 1.25rem; }
.holo-meta dt { font: 0.6rem var(--font-mono); letter-spacing: 0.16em; text-transform: uppercase; color: #8E96B8; }
.holo-meta dd { display: flex; align-items: center; gap: 0.5rem; margin: 0.15rem 0 0; font-size: 0.9rem; color: #F5F7FF; }
.holo-card .social-links { margin: 0; }
.holo-card .social-links a {
    width: 40px;
    height: 40px;
    color: #F5F7FF;
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.14);
}
.holo-mailto {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    align-self: flex-start;
    font: 0.72rem var(--font-mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    transition: color 0.3s ease;
}
.holo-mailto i { font-size: 0.7rem; transition: transform 0.4s var(--ease); }
.holo-mailto:hover { color: var(--accent); }
.holo-mailto:hover i { transform: translateX(4px); }

/* Social-Tooltips */
.social-links a { position: relative; }
.social-links a::after {
    content: attr(data-label);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    translate: -50% 4px;
    padding: 0.25rem 0.5rem;
    font: 0.62rem var(--font-mono);
    letter-spacing: 0.04em;
    white-space: nowrap;
    color: #fff;
    background: rgba(9, 12, 32, 0.94);
    border: 1px solid rgba(139, 92, 246, 0.4);
    border-radius: 6px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, translate 0.25s var(--ease);
}
.social-links a:hover::after, .social-links a:focus-visible::after { opacity: 1; translate: -50% 0; }

/* Brief-Formular */
.letter {
    position: relative;
    gap: 1.15rem;
    padding: 2rem 2.2rem 1.8rem;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012)), var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 30px 70px -40px rgba(0, 0, 0, 0.7);
    overflow: hidden;
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
}
.letter::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(to bottom, transparent 0 2.5rem, rgba(99, 102, 241, 0.06) 2.5rem calc(2.5rem + 1px));
    pointer-events: none;
}
.letter > * { position: relative; }
.letter.writing { border-color: var(--border-strong); box-shadow: 0 30px 70px -40px rgba(0, 0, 0, 0.7), 0 0 50px rgba(99, 102, 241, 0.1); }
.letter-head { display: flex; justify-content: space-between; align-items: flex-start; }
.letter-kicker { font: 0.72rem var(--font-mono); letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent); }
.letter-stamp {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 66px;
    height: 78px;
    color: var(--accent-light);
    background: rgba(99, 102, 241, 0.08);
    border: 2px dashed rgba(139, 92, 246, 0.5);
    border-radius: 8px;
    rotate: 6deg;
    transition: rotate 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.4s ease, background 0.4s ease;
}
.letter-stamp b { font: 800 1.2rem var(--font-display); transition: opacity 0.3s ease; }
.letter-stamp small { font: 0.5rem var(--font-mono); letter-spacing: 0.16em; text-transform: uppercase; transition: opacity 0.3s ease; }
.letter-stamp i {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 1.8rem;
    color: #10B981;
    opacity: 0;
    scale: 0.4;
    transition: opacity 0.3s ease, scale 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.letter.writing .letter-stamp { rotate: -5deg; border-color: rgba(236, 72, 153, 0.6); }
.letter.sent .letter-stamp { background: rgba(16, 185, 129, 0.12); border-color: #10B981; animation: stampHit 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); }
.letter.sent .letter-stamp i { opacity: 1; scale: 1; }
.letter.sent .letter-stamp b, .letter.sent .letter-stamp small { opacity: 0.12; }
@keyframes stampHit { 0% { scale: 1.5; rotate: -18deg; } 100% { scale: 1; } }
.letter-line {
    margin: 0;
    font-family: var(--font-serif);
    font-size: clamp(1.25rem, 1.9vw, 1.6rem);
    line-height: 2.05;
    color: var(--text-primary);
}
.ml {
    min-width: 6ch;
    max-width: 100%;
    margin: 0 0.15em;
    padding: 0 0.25em 0.05em;
    font: 500 0.8em var(--font-sans);
    color: var(--accent-light);
    background: transparent;
    border: 0;
    border-bottom: 1.5px dashed rgba(139, 92, 246, 0.55);
    border-radius: 4px 4px 0 0;
    outline: none;
    transition: border-color 0.3s ease, background 0.3s ease;
}
.ml::placeholder { color: var(--text-muted); font-style: italic; opacity: 1; }
.ml:focus { border-bottom-style: solid; border-color: var(--accent-lighter); background: rgba(99, 102, 241, 0.08); }
.ml:user-invalid { border-color: #EF4444; }
[data-theme="light"] .ml { color: var(--accent); }
.letter-msg label {
    display: block;
    margin-bottom: 0.5rem;
    font: 0.68rem var(--font-mono);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.letter-msg textarea {
    width: 100%;
    min-height: 130px;
    padding: 0.9rem 1rem;
    font: inherit;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--border);
    border-radius: 14px;
    outline: none;
    resize: vertical;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.letter-msg textarea::placeholder { color: var(--text-muted); }
.letter-msg textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12); }
.letter-foot { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.letter-sign { font-family: var(--font-serif); font-style: italic; font-size: 1.3rem; color: var(--text-secondary); }
.letter .btn-submit { margin: 0; align-self: auto; }

/* ---------------------------------------------------------
   7) FOOTER — Back-to-top-Ring
   --------------------------------------------------------- */
.to-top { display: inline-flex; align-items: center; gap: 0.7rem; color: var(--text-primary); }
.tt-ring { position: relative; display: grid; place-items: center; width: 40px; height: 40px; }
.tt-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.tt-ring circle { fill: none; stroke: var(--border); stroke-width: 2; }
.tt-ring .tt-prog { stroke: var(--accent-lighter); stroke-linecap: round; filter: drop-shadow(0 0 3px rgba(236, 72, 153, 0.6)); }
.tt-ring i { font-size: 0.75rem; transition: transform 0.4s var(--ease); }
.to-top:hover .tt-ring i { transform: translateY(-3px); }
.to-top:hover { color: var(--accent); }

/* ---------------------------------------------------------
   8) ⌘K — Secret-Sammlung (klar getrennt von den Aktionen)
   --------------------------------------------------------- */
.cmdk-scroll {
    max-height: min(54vh, 500px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0.5rem 0.6rem 0.75rem;
    scrollbar-width: thin;
    scrollbar-color: var(--surface-elev) transparent;
}
.cmdk-scroll .cmdk-list { max-height: none; overflow: visible; padding: 0; }
.cmdk-collection {
    margin: 0.8rem 0.15rem 0.15rem;
    padding: 0.85rem 0.85rem 0.7rem;
    border-radius: 14px;
    border: 1px dashed var(--border-strong);
    background: repeating-linear-gradient(-45deg, rgba(99, 102, 241, 0.035) 0 10px, transparent 10px 20px);
}
.cs-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font: 600 0.64rem var(--font-mono);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-secondary);
}
.cs-title i { margin-right: 0.35rem; color: #F59E0B; }
.cs-count { color: var(--accent-lighter); }
.cs-bar { height: 3px; margin: 0.6rem 0 0.65rem; border-radius: 3px; background: var(--border); overflow: hidden; }
.cs-bar i { display: block; height: 100%; background: var(--accent-gradient); transition: width 0.6s var(--ease); }
.cs-list { display: grid; gap: 1px; list-style: none; margin: 0; padding: 0; }
.cs-item {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0.25rem;
    font-size: 0.86rem;
    color: var(--text-muted);
}
.cs-ic {
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border: 1.5px dashed var(--text-muted);
    border-radius: 50%;
    font-size: 0.55rem;
}
.cs-name { letter-spacing: 0.08em; }
.cs-item.found .cs-ic { border: none; background: #10B981; color: #fff; }
.cs-item.found .cs-name { color: var(--text-primary); letter-spacing: 0; }
.cs-state { font: 0.6rem var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: #10B981; }
.cs-tip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.7rem;
    font: 500 0.66rem var(--font-mono);
    letter-spacing: 0.04em;
    color: #FBBF24;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.45);
    border-radius: 100px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}
.cs-tip:hover, .cs-tip:focus-visible { background: rgba(245, 158, 11, 0.18); border-color: #F59E0B; outline: none; }
.cs-hint {
    grid-column: 2 / -1;
    margin: 0.2rem 0 0.25rem;
    padding: 0.55rem 0.75rem;
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--text-primary);
    background: rgba(245, 158, 11, 0.07);
    border-left: 2px solid #F59E0B;
    border-radius: 8px;
}
.cs-foot { margin: 0.7rem 0 0; font: 0.62rem var(--font-mono); color: var(--text-muted); }
.cs-foot b { color: var(--text-secondary); font-weight: 600; }
[data-theme="light"] .cs-tip { color: #B45309; background: rgba(245, 158, 11, 0.12); }
@media (max-width: 600px) { .cmdk-scroll { max-height: 62vh; } }

/* ---------------------------------------------------------
   9) SECRETS — Lichtschalter-Hinweis & Taschenlampe
   --------------------------------------------------------- */
.lt-bubble {
    position: fixed;
    z-index: 9600;
    translate: -50% 6px;
    padding: 0.45rem 0.8rem;
    font: 500 0.74rem var(--font-mono);
    white-space: nowrap;
    color: var(--text-primary);
    background: rgba(15, 20, 48, 0.94);
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.6);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, translate 0.4s var(--ease);
}
.lt-bubble::before {
    content: '';
    position: absolute;
    left: 50%;
    top: -5px;
    width: 9px;
    height: 9px;
    translate: -50% 0;
    rotate: 45deg;
    background: inherit;
    border-left: 1px solid var(--border-strong);
    border-top: 1px solid var(--border-strong);
}
.lt-bubble.show { opacity: 1; translate: -50% 0; }
[data-theme="light"] .lt-bubble { background: rgba(255, 255, 255, 0.96); }
.theme-toggle.flick i { animation: flick 0.5s var(--ease); }
@keyframes flick { 40% { transform: rotate(-40deg) scale(0.7); } }
.flashlight {
    position: fixed;
    inset: 0;
    z-index: 9350;
    pointer-events: none;
    background: radial-gradient(circle 210px at var(--x, 50%) var(--y, 50%),
        rgba(3, 4, 12, 0) 0%, rgba(3, 4, 12, 0.18) 38%, rgba(3, 4, 12, 0.9) 72%, rgba(3, 4, 12, 0.97) 100%);
    animation: flIn 0.6s ease both;
}
.flashlight.out { animation: flOut 0.55s ease both; }
@keyframes flIn { from { opacity: 0; } }
@keyframes flOut { to { opacity: 0; } }
.flashlight-off {
    position: fixed;
    z-index: 9351;
    left: 50%;
    bottom: max(1.6rem, env(safe-area-inset-bottom));
    translate: -50% 0;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.2rem;
    font: 500 0.74rem var(--font-mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #FDE68A;
    background: rgba(15, 20, 48, 0.85);
    border: 1px solid rgba(245, 158, 11, 0.5);
    border-radius: 100px;
    cursor: pointer;
    animation: flIn 0.6s ease both 0.3s;
}
.flashlight-off.out { animation: flOut 0.4s ease both; }

/* Buttons: Licht folgt dem Cursor */
.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
    background: radial-gradient(110px circle at var(--bx, 50%) var(--by, 50%), rgba(255, 255, 255, 0.26), transparent 62%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.btn:hover::after { opacity: 1; }
.btn-ghost::after { background: radial-gradient(110px circle at var(--bx, 50%) var(--by, 50%), rgba(139, 92, 246, 0.25), transparent 62%); }

/* ---------------------------------------------------------
   10) RESPONSIVE
   --------------------------------------------------------- */
@media (max-width: 1280px) {
    .ptable { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
    .about-layout { grid-template-columns: 1fr; gap: 2.2rem; margin-bottom: 3rem; }
    .about-left { position: relative; top: auto; }
    .stats-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ct-grid { grid-template-columns: 1fr; gap: 2rem; }
    .holo { max-width: 520px; }
}
@media (max-width: 860px) {
    .hero-name { --nameFs: min(18.5vw, 22vh, 9rem); }
    .hero-statement { position: static; width: auto; max-width: 36rem; margin-top: 1.4rem; }
    .hero-bottom { flex-direction: column; align-items: stretch; gap: 1.4rem; margin-top: 1.6rem; }
    .id-card.hero-meta { width: 100%; }
    .hero-coords span { display: none; }
    .hero-coords b { border-left: 0; padding-left: 0; }
}
@media (max-width: 768px) {
    .hero-v2 { padding-top: 5.6rem; padding-bottom: 2rem; }
    .about-v2 .about-quote { font-size: clamp(1.3rem, 5vw, 1.8rem); }
    .about-sign { font-size: 1.35rem; margin-top: 0.9rem; }
    .facts { grid-template-columns: 1fr; margin-top: 1.6rem; }
    .stat-tile { min-height: 180px; padding: 1.15rem 1rem 1rem; }
    .st-num { font-size: 2.4rem; margin-bottom: 0.6rem; }
    .ptable-head { grid-template-columns: 1fr; }
    .ptable-hint { text-align: left; }
    .ptable { gap: 0.6rem; }
    .el-face { padding: 0.65rem 0.65rem; }
    .el-sym { font-size: 1.9rem; left: 0.65rem; }
    .el-name { left: 0.65rem; bottom: 1.7rem; font-size: 0.78rem; }
    .el-cat { left: 0.65rem; bottom: 0.65rem; }
    .el-icon { right: 0.65rem; bottom: 0.65rem; font-size: 0.85rem; }
    .el-lvl { top: 0.8rem; right: 0.65rem; }
    .el-desc { font-size: 0.66rem; }
    .el-used { font-size: 0.6rem; }
    .work-v2 .wk-side .section-header { margin-bottom: 2rem; }
    .proj-info { padding: 1.1rem 1.1rem 1.25rem; }
    .proj-info h3 { font-size: 1.15rem; }
    .letter { padding: 1.4rem 1.25rem 1.3rem; border-radius: 18px; }
    .letter-line { font-size: 1.15rem; line-height: 2.1; }
    .letter-stamp { width: 54px; height: 64px; }
    .letter-foot { flex-direction: column-reverse; align-items: stretch; }
    .letter .btn-submit { width: 100%; justify-content: center; }
    .letter-sign { text-align: center; }
    .holo-card { padding: 1.35rem 1.25rem 1.2rem; }
    .holo-mail { font-size: 0.85rem; }
}
@media (max-width: 480px) {
    .stats-rail { grid-template-columns: 1fr 1fr; gap: 0.7rem; }
    .stat-tile { min-height: 170px; }
    .st-sub { font-size: 0.68rem; }
    .el-desc { font-size: 0.72rem; }
    .el-used { font-size: 0.64rem; }
    .hero-actions { flex-direction: column; align-items: stretch; }
}

/* ---------------------------------------------------------
   11) REDUCED MOTION / PRINT
   --------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .id-line dd { animation: none !important; clip-path: none !important; }
    .scroll-badge svg, .holo-shine, .id-caret, .hero-coords b::before { animation: none !important; }
    .holo-card { transform: none !important; }
    .el-inner { transform: rotateY(calc(var(--flip, 0) * 180deg)) !important; }
}
@media print {
    .scroll-badge, .wk-list, .wk-index, .holo-shine, .holo-grain, .flashlight, .flashlight-off, .lt-bubble, .letter-stamp { display: none !important; }
    .about-left { position: static; }
    .el-back { display: none !important; }
    .el-inner { transform: none !important; }
}

/* Rollende Projektnummer (Leitmotiv) */
.wi-roll {
    display: flex;
    flex-direction: column;
    transform: translateY(calc(var(--wi, 0) * -1em));
    transition: transform 0.9s cubic-bezier(0.7, 0, 0.2, 1);
}
.wi-roll b { display: block; height: 1em; font-weight: inherit; }
@media (max-width: 860px) { .hero-scroll.scroll-badge { display: none; } }

/* Während des Theme-Wipes keine Klicks verschlucken */
::view-transition { pointer-events: none; }

/* Sektions-Leiste nur, wenn links genug Rand ist (überlappte sonst den Hero) */
@media (max-width: 1360px) { .section-rail { display: none; } }

/* Niedrige Laptop-Screens: Hero kompakter, alles above the fold */
@media (min-width: 861px) and (max-height: 820px) {
    .hero-v2 { padding-top: 6.1rem; padding-bottom: 1.5rem; }
    .hero-name { --nameFs: min(14.2vw, 21.5vh, 15rem); margin-top: 0.9rem; }
    .hero-bottom { margin-top: 1rem; }
    .id-bar { padding: 0.45rem 0.9rem; }
    .id-lines { gap: 0.28rem; padding-top: 0.6rem; }
    .id-line dd { font-size: 0.84rem; }
    .id-prompt { padding-bottom: 0.6rem; }
    .hero-scroll.scroll-badge { width: 80px; height: 80px; }
}

/* Deck-Karte sitzt direkt über ihrem Text (Luft bleibt oben für die Stapel-Vorschau) */
.deck-on .proj-media { align-self: end; }

/* Periodensystem-Spalten: Rückseiten passen ohne internen Scroll */
@media (max-width: 1024px) { .ptable { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px)  { .ptable { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 380px) { .el { aspect-ratio: 1 / 1.3; } }

/* Schwerkraft: Taschenlampen-Füllung folgt den gefallenen Buchstaben nicht → ausblenden */
body.gravity-on .kinetic-word.outline::after,
body.gravity-on .footer-giant span::after { opacity: 0 !important; transition: none; }
