/* =========================================================
   capturedbyemo — base.css
   Shared: Tokens, Reset, Nav, Footer, Reveal, Transitions
   ========================================================= */

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

:root {
    /* Colors — default black theme */
    --paper:     #0a0a0b;
    --paper-2:   #050506;
    --ink:       #f3f1ec;
    --ink-dim:   rgba(243, 241, 236, 0.72);
    --ink-mute:  rgba(243, 241, 236, 0.46);
    --line:      rgba(243, 241, 236, 0.18);
    --line-soft: rgba(243, 241, 236, 0.10);

    /* Type */
    --f-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;

    /* Motion */
    --ease:      cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out:  cubic-bezier(0.16, 1, 0.3, 1);

    /* Layout */
    --max: 1480px;
    --pad: clamp(22px, 4.2vw, 64px);
    --nav-h: clamp(58px, 7vh, 72px);
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--paper);
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

body {
    font-family: var(--f-sans);
    background: var(--paper);
    color: var(--ink);
    line-height: 1.55;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-feature-settings: "ss01", "cv11";
    font-size: 1rem;
}

img {
    max-width: 100%;
    height: auto;
    display: block;

    /* Image-Protection: gegen casual Save / Drag */
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    /* Pointer-events: none → Rechtsklick zielt nicht auf das Bild,
       sondern auf den Parent — damit fehlt die "Bild speichern" Option
       im Context-Menü. Click-Handler funktionieren weiter via Event-
       Delegation auf den Card-/Lightbox-Containern. */
    pointer-events: none;
}

a { color: inherit; text-decoration: none; }
a,
button,
[role="button"],
input,
select,
textarea {
    font-size: max(1rem, 16px);
}
a,
button,
[role="button"],
.nav__burger {
    min-width: 44px;
    min-height: 44px;
}
ul, ol { list-style: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; }
::selection { background: var(--ink); color: var(--paper); }

/* Body-Class-Hooks für Seiten mit abweichender Stimmung
   Alle Inside-Seiten laufen auf Magazin-Rot. Mono leicht tiefer,
   Color mit extrem feinem Cream-Grain als haptische Andeutung. */
body.page-mono    { background: var(--paper-2); }
body.page-mono .nav.is-scrolled { background: rgba(73, 15, 23, 0.88); }

body.page-color {
    background-color: var(--paper);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 260 260'><filter id='p'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.93  0 0 0 0 0.89  0 0 0 0 0.80  0 0 0 0.06 0'/></filter><rect width='100%25' height='100%25' filter='url(%23p)'/></svg>");
    background-size: 260px 260px;
    background-repeat: repeat;
    background-attachment: fixed;
}
body.page-color .nav.is-scrolled { background: rgba(92, 20, 29, 0.88); }
body.page-events  .nav.is-scrolled { background: rgba(92, 20, 29, 0.88); }
body.page-project .nav.is-scrolled { background: rgba(92, 20, 29, 0.88); }

/* =========================================================
   PAGE TRANSITION (cross-fade, soft)
   ========================================================= */
@keyframes pageIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.page {
    animation: pageIn 0.7s var(--ease-out) both;
    flex: 1;
    display: flex;
    flex-direction: column;
}
body.is-leaving .page {
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.38s var(--ease), transform 0.38s var(--ease);
}

/* Lenis smooth-scroll hook: no native smooth while Lenis runs */
html.lenis { height: auto; scroll-behavior: auto; }
html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

/* =========================================================
   NAV — minimal, wordmark links / categories rechts
   ========================================================= */
.nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    height: var(--nav-h);
    display: flex;
    align-items: center;
    transition: background 0.4s var(--ease), border-color 0.4s var(--ease);
    border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
    background: rgba(92, 20, 29, 0.88);
    backdrop-filter: saturate(140%) blur(18px);
    -webkit-backdrop-filter: saturate(140%) blur(18px);
    border-bottom-color: var(--line-soft);
}

.nav__inner {
    width: 100%;
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 var(--pad);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.nav__logo {
    display: inline-flex;
    align-items: baseline;
    min-height: 44px;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--ink);
    transition: opacity 0.3s var(--ease);
}

.nav__list {
    position: fixed;
    inset: var(--nav-h) 0 auto 0;
    background: rgba(92, 20, 29, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 28px var(--pad) 36px;
    gap: 18px;
    border-bottom: 1px solid var(--line-soft);
    transform: translateY(-110%);
    transition: transform 0.45s var(--ease-out);
}
.nav__list.is-open {
    transform: translateY(0);
}
.nav__list a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-dim);
    padding: 6px 0;
    position: relative;
    transition: color 0.3s var(--ease);
}
.nav__list a.is-active { color: var(--ink); }
.nav__list a.is-active::after {
    content: "";
    position: absolute;
    left: 0; right: 0;
    bottom: 0;
    height: 1px;
    background: var(--ink);
}

/* Burger (Mobile) */
.nav__burger {
    display: flex;
    width: 44px;
    height: 44px;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    align-items: center;
    cursor: pointer;
}
.nav__burger span {
    display: block;
    height: 1px;
    width: 24px;
    background: var(--ink);
    transition: transform 0.3s var(--ease), opacity 0.25s;
    transform-origin: center;
}
.nav__burger.is-active span:first-child {
    transform: translateY(4.5px) rotate(45deg);
}
.nav__burger.is-active span:last-child {
    transform: translateY(-4.5px) rotate(-45deg);
}

/* =========================================================
   FOOTER — clean, one line
   ========================================================= */
.footer {
    margin-top: auto;
    border-top: 1px solid var(--line-soft);
    padding: clamp(26px, 4vh, 40px) var(--pad);
}
.footer__inner {
    max-width: var(--max);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    font-size: 1rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-dim);
    font-weight: 400;
}
.footer__inner a {
    color: var(--ink-dim);
    transition: color 0.3s var(--ease);
}

/* =========================================================
   LEGAL PAGES
   ========================================================= */
.legal {
    width: 100%;
    padding: calc(var(--nav-h) + clamp(56px, 9vh, 120px)) var(--pad) clamp(58px, 10vh, 120px);
}
.legal__inner {
    width: min(860px, 100%);
    margin: 0 auto;
}
.legal__eyebrow {
    margin: 0 0 20px;
    font-size: 0.72rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--ink-mute);
}
.legal h1 {
    margin: 0 0 clamp(36px, 7vh, 72px);
    font-size: clamp(2.4rem, 8vw, 6.4rem);
    font-weight: 300;
    letter-spacing: -0.02em;
    line-height: 0.95;
}
.legal__intro {
    margin: -38px 0 clamp(36px, 6vh, 64px);
    max-width: 680px;
    color: var(--ink-dim);
    font-size: clamp(1rem, 1.4vw, 1.18rem);
}
.legal__block {
    padding: clamp(24px, 4vh, 38px) 0;
    border-top: 1px solid var(--line-soft);
}
.legal__block:last-child {
    border-bottom: 1px solid var(--line-soft);
}
.legal__block h2 {
    margin: 0 0 14px;
    font-size: clamp(1.15rem, 2vw, 1.55rem);
    font-weight: 400;
    letter-spacing: 0.02em;
}
.legal__block p {
    max-width: 760px;
    margin: 0;
    color: var(--ink-dim);
    font-size: 1rem;
    line-height: 1.8;
}
.legal__block p + p {
    margin-top: 16px;
}
.legal__block a {
    color: var(--ink);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.22em;
}

/* =========================================================
   REVEAL — staggered fade + translate, Framer-style
   JS setzt --reveal-delay pro Element (0–180ms Cap).
   ========================================================= */
.reveal {
    opacity: 0;
    transform: translateY(22px);
    transition:
        opacity 1.1s var(--ease-out),
        transform 1.1s var(--ease-out);
    transition-delay: var(--reveal-delay, 0ms);
    will-change: opacity, transform;
}
.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Text-Reveal (Headlines) — feiner, kürzer */
.reveal-text {
    opacity: 0;
    transform: translateY(10px);
    transition:
        opacity 0.9s var(--ease-out),
        transform 0.9s var(--ease-out);
    transition-delay: var(--reveal-delay, 0ms);
}
.reveal-text.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================================
   CUSTOM CURSOR — dezent, Framer-Feel. Mobile: aus.
   ========================================================= */
.cb-cursor {
    position: fixed;
    top: 0; left: 0;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: var(--ink);
    mix-blend-mode: difference;
    pointer-events: none;
    z-index: 9999;
    transform: translate3d(-50%, -50%, 0) scale(1);
    transition:
        width 0.35s var(--ease-out),
        height 0.35s var(--ease-out),
        background 0.35s var(--ease),
        opacity 0.3s var(--ease);
    opacity: 0;
}
.cb-cursor.is-active { opacity: 1; }
.cb-cursor.is-hidden { opacity: 0; }
.cb-cursor__label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.58rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--paper);
    opacity: 0;
    transition: opacity 0.25s var(--ease);
    white-space: nowrap;
}
.cb-cursor.is-hover {
    width: 104px;
    height: 104px;
    background: var(--ink);
}
.cb-cursor.is-hover .cb-cursor__label { opacity: 1; }
.cb-cursor.is-pressing { transform: translate3d(-50%, -50%, 0) scale(0.82); }

/* Mobile / Touch: Cursor aus */
@media (hover: none), (pointer: coarse) {
    .cb-cursor { display: none; }
}

/* =========================================================
   UTILITIES
   ========================================================= */
.label {
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-dim);
    font-variant-numeric: tabular-nums;
}
.num {
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    color: var(--ink-mute);
    font-variant-numeric: tabular-nums;
}

.page-head {
    max-width: var(--max);
    margin: 0 auto;
    padding: calc(var(--nav-h) + clamp(70px, 10vh, 130px)) var(--pad) clamp(40px, 6vh, 70px);
    display: grid;
    grid-template-columns: 1fr;
    align-items: end;
    gap: 16px;
    border-bottom: 1px solid var(--line-soft);
    position: relative;
}
/* page-head__title erhält reveal-text falls im HTML gesetzt */
.page-head__title,
.page-head__meta { transition-delay: 0ms; }
.page-head__title {
    font-size: clamp(2rem, 5vw, 3.6rem);
    font-weight: 300;
    letter-spacing: -0.02em;
    line-height: 1;
    color: var(--ink);
}
.page-head__meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    text-align: left;
}

@media (hover: hover) and (pointer: fine) {
    .nav__logo:hover { opacity: 0.62; }
    .nav__list a:hover { color: var(--ink); }
    .footer__inner a:hover { color: var(--ink); }
}

@media (hover: none), (pointer: coarse) {
    *:hover {
        transition-duration: 0s;
    }
}

/* =========================================================
   RESPONSIVE — Mobile first breakpoints
   ========================================================= */
@media (min-width: 640px) {
    :root { --pad: clamp(22px, 4.2vw, 64px); }
}

@media (min-width: 768px) {
    .nav__list {
        position: static;
        inset: auto;
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        flex-direction: column;
        align-items: center;
        flex-direction: row;
        padding: 0;
        gap: clamp(26px, 3vw, 44px);
        border-bottom: 0;
        transform: none;
        transition: none;
    }
    .nav__list a {
        min-height: 44px;
        font-size: 0.72rem;
        padding: 6px 0;
    }
    .nav__burger { display: none; }

    .page-head {
        grid-template-columns: 1fr auto;
        gap: 24px;
    }
    .page-head__meta {
        align-items: flex-end;
        text-align: right;
    }
}

@media (min-width: 1280px) {
    :root { --nav-h: clamp(58px, 7vh, 72px); }
}

@media (max-width: 767.98px) {
    body.page-mono .nav__list {
        background: rgba(107, 25, 35, 0.96);
    }
    .label,
    .num,
    .page-head__meta,
    .footer__inner {
        font-size: 1rem;
    }
    .footer__inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        letter-spacing: 0.16em;
    }
}

/* Extra-schmale Screens: Nav padding und Burger sauber */
@media (max-width: 639.98px) {
    :root { --pad: 18px; }
    .nav__logo { font-size: 1rem; }
    .footer__inner { gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    .reveal,
    .reveal-text {
        opacity: 1;
        transform: none;
    }
    .cb-cursor { display: none; }
}

/* =========================================================
   THEMES — switchable via html[data-theme]
   Default (kein Attribut oder "black") = Schwarz.
   Settings.js setzt das Attribut basierend auf localStorage.
   ========================================================= */

/* ---------- RED ---------- */
html[data-theme="red"] {
    --paper:     #5c141d;
    --paper-2:   #490f17;
    --ink:       #ede3cd;
    --ink-dim:   #c9bc9f;
    --ink-mute:  #a09378;
    --line:      rgba(237, 227, 205, 0.18);
    --line-soft: rgba(237, 227, 205, 0.10);
}
html[data-theme="red"] .nav.is-scrolled,
html[data-theme="red"] body.page-color  .nav.is-scrolled,
html[data-theme="red"] body.page-events .nav.is-scrolled,
html[data-theme="red"] body.page-project .nav.is-scrolled {
    background: rgba(92, 20, 29, 0.88);
}
html[data-theme="red"] body.page-mono .nav.is-scrolled {
    background: rgba(73, 15, 23, 0.88);
}
html[data-theme="red"] body.page-archive {
    --paper-arc:        #490f17;
    --paper-arc-2:      #3a0c12;
    --ink-arc:          #ede3cd;
    --ink-arc-dim:      rgba(237, 227, 205, 0.72);
    --ink-arc-mute:     rgba(237, 227, 205, 0.46);
    --ink-arc-soft:     rgba(237, 227, 205, 0.22);
    --line-arc:         rgba(237, 227, 205, 0.10);
    --line-arc-strong:  rgba(237, 227, 205, 0.22);
}
html[data-theme="red"] body.page-archive .nav.is-scrolled {
    background: rgba(58, 12, 18, 0.88);
}

/* ---------- BLACK ---------- */
html[data-theme="black"] {
    --paper:     #0a0a0b;
    --paper-2:   #050506;
    --ink:       #f3f1ec;
    --ink-dim:   rgba(243, 241, 236, 0.72);
    --ink-mute:  rgba(243, 241, 236, 0.46);
    --line:      rgba(243, 241, 236, 0.18);
    --line-soft: rgba(243, 241, 236, 0.10);
}
html[data-theme="black"] .nav.is-scrolled,
html[data-theme="black"] body.page-mono   .nav.is-scrolled,
html[data-theme="black"] body.page-color  .nav.is-scrolled,
html[data-theme="black"] body.page-events .nav.is-scrolled,
html[data-theme="black"] body.page-project .nav.is-scrolled,
html[data-theme="black"] body.page-archive .nav.is-scrolled {
    background: rgba(10, 10, 11, 0.88);
}
html[data-theme="black"] body.page-archive {
    --paper-arc:        #0a0a0b;
    --paper-arc-2:      #050506;
    --ink-arc:          #f3f1ec;
    --ink-arc-dim:      rgba(243, 241, 236, 0.72);
    --ink-arc-mute:     rgba(243, 241, 236, 0.46);
    --ink-arc-soft:     rgba(243, 241, 236, 0.22);
    --line-arc:         rgba(243, 241, 236, 0.10);
    --line-arc-strong:  rgba(243, 241, 236, 0.22);
}
/* Color-Page Paper-Grain bei dunklem Theme entfernen */
html[data-theme="black"] body.page-color { background-image: none; }

/* ---------- WHITE ---------- */
html[data-theme="white"] {
    --paper:     #f4f2ed;
    --paper-2:   #ece9e1;
    --ink:       #1a1715;
    --ink-dim:   rgba(26, 23, 21, 0.72);
    --ink-mute:  rgba(26, 23, 21, 0.46);
    --line:      rgba(26, 23, 21, 0.18);
    --line-soft: rgba(26, 23, 21, 0.10);
}
html[data-theme="white"] .nav.is-scrolled,
html[data-theme="white"] body.page-mono   .nav.is-scrolled,
html[data-theme="white"] body.page-color  .nav.is-scrolled,
html[data-theme="white"] body.page-events .nav.is-scrolled,
html[data-theme="white"] body.page-project .nav.is-scrolled,
html[data-theme="white"] body.page-archive .nav.is-scrolled {
    background: rgba(244, 242, 237, 0.92);
}
html[data-theme="white"] body.page-archive {
    --paper-arc:        #f4f2ed;
    --paper-arc-2:      #ece9e1;
    --ink-arc:          #1a1715;
    --ink-arc-dim:      rgba(26, 23, 21, 0.72);
    --ink-arc-mute:     rgba(26, 23, 21, 0.46);
    --ink-arc-soft:     rgba(26, 23, 21, 0.22);
    --line-arc:         rgba(26, 23, 21, 0.10);
    --line-arc-strong:  rgba(26, 23, 21, 0.22);
}

html[data-theme] body.page-archive .nav.is-scrolled {
    background: transparent;
    border-bottom-color: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
html[data-theme="white"] body.page-color { background-image: none; }

/* Cursor-Toggle: deaktiviert die Custom-Cursor-Anzeige */
html[data-cursor="off"] .cb-cursor {
    display: none !important;
}
