/* ============================================================
   QISSES — „Das Skizzenbuch"
   Flash-2006-Hommage: die ganze Seite ist ein Bild.
   Palette: Wein #451317 · Papier #E9E2CF · Tinte #29221B
            Rost #9A3B1E · Oliv #75713A · Honig #C98A2B
   ============================================================ */

@font-face {
    font-family: 'IM Fell English';
    src: url('fonts/im-fell-english.woff2') format('woff2');
    font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'IM Fell English';
    src: url('fonts/im-fell-english-italic.woff2') format('woff2');
    font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
    font-family: 'IM Fell English SC';
    src: url('fonts/im-fell-english-sc.woff2') format('woff2');
    font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'EB Garamond';
    src: url('fonts/eb-garamond.woff2') format('woff2');
    font-weight: 400 800; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'EB Garamond';
    src: url('fonts/eb-garamond-italic.woff2') format('woff2');
    font-weight: 400 800; font-style: italic; font-display: swap;
}
@font-face {
    font-family: 'Special Elite';
    src: url('fonts/special-elite.woff2') format('woff2');
    font-weight: 400; font-style: normal; font-display: swap;
}

:root {
    --wein: #451317;
    --wein-tief: #2B0B0E;
    --papier: #E9E2CF;
    --papier-dunkel: #D8CDB2;
    --tinte: #29221B;
    --tinte-blass: #4A4034;
    --rost: #9A3B1E;
    --oliv: #75713A;
    --honig: #C98A2B;
    --messing: #B08A3E;
    --creme-hell: #F3EDDC;

    --schreibmaschine: 'Special Elite', 'Courier New', monospace;
    --fell: 'IM Fell English', Georgia, serif;
    --fell-sc: 'IM Fell English SC', Georgia, serif;
    --garamond: 'EB Garamond', Georgia, serif;
}

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

html, body { height: 100%; }

body {
    background: var(--wein-tief);
    color: var(--tinte);
    font-family: var(--garamond);
    font-size: 17px;
    line-height: 1.6;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

::selection { background: var(--honig); color: var(--tinte); }

/* ---------- Preloader / Enter-Splash ---------- */

#lade {
    position: fixed; inset: 0; z-index: 100;
    background: var(--wein-tief);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 26px;
    transition: opacity .7s ease;
}
#lade.weg { opacity: 0; pointer-events: none; }

.lade-wortmarke {
    font-family: var(--fell);
    font-size: clamp(2.6rem, 6vw, 4rem);
    color: var(--papier);
    letter-spacing: .02em;
}
.lade-wortmarke .punkt { color: var(--honig); }

.lade-balken {
    width: min(320px, 70vw); height: 3px;
    background: rgba(233, 226, 207, .18);
    position: relative;
}
.lade-balken .voll {
    position: absolute; inset: 0 auto 0 0; width: 0%;
    background: var(--honig);
    transition: width .25s ease;
}
.lade-status {
    font-family: var(--schreibmaschine);
    font-size: .72rem; letter-spacing: .22em; text-transform: uppercase;
    color: rgba(233, 226, 207, .55);
}

.lade-eintritt { display: none; flex-direction: column; align-items: center; gap: 14px; }
#lade.bereit .lade-balken, #lade.bereit .lade-status { display: none; }
#lade.bereit .lade-eintritt { display: flex; }

.btn-eintreten {
    font-family: var(--schreibmaschine);
    font-size: .95rem; letter-spacing: .3em; text-transform: uppercase;
    color: var(--papier);
    background: transparent;
    border: 1px solid rgba(233, 226, 207, .45);
    padding: 16px 38px 14px;
    cursor: pointer;
    transition: background .25s, color .25s, border-color .25s;
}
.btn-eintreten:hover, .btn-eintreten:focus-visible {
    background: var(--papier); color: var(--wein-tief); border-color: var(--papier);
}
.btn-ohne-ton {
    font-family: var(--schreibmaschine);
    font-size: .68rem; letter-spacing: .2em; text-transform: uppercase;
    color: rgba(233, 226, 207, .45);
    background: none; border: none; cursor: pointer;
    text-decoration: underline; text-underline-offset: 4px;
}
.btn-ohne-ton:hover, .btn-ohne-ton:focus-visible { color: var(--papier); }

/* ---------- Bühne (Damast-Tapete) ---------- */

#buehne {
    position: fixed; inset: 0;
    background: var(--wein) url('img/tapete-damast.webp') repeat center / 512px auto;
    display: flex; align-items: center; justify-content: center;
}
#buehne::after {
    /* Vignette wie ein altes Theater */
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background: radial-gradient(ellipse 90% 80% at 50% 42%,
        transparent 0%, transparent 46%, rgba(20, 5, 6, .55) 100%);
}

/* ---------- Der Spiralblock ---------- */

#block {
    position: relative; z-index: 2;
    width: min(920px, calc(100vw - 28px));
    height: min(850px, calc(100dvh - 66px));
    display: flex; flex-direction: column;
    background: var(--papier);
    box-shadow:
        0 2px 4px rgba(0, 0, 0, .4),
        0 24px 70px rgba(0, 0, 0, .55),
        inset 0 0 60px rgba(120, 90, 40, .12);
    transform: rotate(-.35deg);
}

/* Spiralbindung links */
#block::before {
    content: ''; position: absolute; z-index: 6;
    top: 0; bottom: 0; left: 0; width: 40px;
    background:
        radial-gradient(circle 5px at 20px 14px, rgba(30, 10, 10, .92) 0 4.4px, rgba(233, 226, 207, .28) 4.6px 5.4px, transparent 5.8px);
    background-size: 40px 30px;
    background-repeat: repeat-y;
    pointer-events: none;
    filter: drop-shadow(1px 1px 0 rgba(255, 252, 240, .35));
}
#block::after {
    /* Falz-Schatten neben der Bindung */
    content: ''; position: absolute; z-index: 5;
    top: 0; bottom: 0; left: 34px; width: 26px;
    background: linear-gradient(90deg, rgba(60, 40, 20, .18), transparent);
    pointer-events: none;
}

/* ---------- Kopfblatt (Collage) ---------- */

#kopfblatt {
    position: relative;
    height: clamp(170px, 31%, 300px);
    background: url('img/kopfblatt-collage.webp') no-repeat left center / cover;
    flex: none;
    overflow: hidden;
}
#kopfblatt::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 10px;
    background: linear-gradient(180deg, transparent, rgba(70, 50, 25, .28));
}

.kopf-text {
    position: absolute; top: 50%; right: 4.5%;
    transform: translateY(-50%);
    width: min(52%, 430px);
    text-align: left;
}
.kopf-eyebrow {
    font-family: var(--schreibmaschine);
    font-size: clamp(.56rem, .8vw, .7rem); letter-spacing: .24em; text-transform: uppercase;
    color: var(--rost);
    margin-bottom: 10px;
}
.kopf-text h1 {
    font-family: var(--fell);
    font-weight: 400;
    font-size: clamp(1.35rem, 2.9vw, 2.45rem);
    line-height: 1.08;
    color: var(--tinte);
}
.kopf-text h1 em {
    font-style: italic;
    border-bottom: 2px solid var(--honig);
}
.kopf-zitat {
    margin-top: 12px;
    font-family: var(--garamond);
    font-style: italic;
    font-size: clamp(.82rem, 1.1vw, .98rem);
    color: var(--tinte-blass);
}

/* ---------- Menü-Bänder ---------- */

#ribbons {
    position: relative; z-index: 8;
    display: flex; flex-direction: column;
    gap: 4px;
    padding: 6px 0;
    flex: none;
}

.ribbon {
    position: relative;
    display: flex; align-items: baseline; gap: 18px;
    width: calc(100% + 18px);
    margin-left: -9px;
    padding: 8px 26px 6px 56px;
    border: none;
    cursor: pointer;
    text-align: left;
    color: var(--creme-hell);
    box-shadow: 0 2px 5px rgba(20, 5, 5, .45);
    transition: transform .22s ease, filter .22s ease;
    background-image: linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(0, 0, 0, .14) 92%);
}
.ribbon::before {
    /* Filmstreifen-Endstück links, wie im Original */
    content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 30px;
    background: repeating-linear-gradient(90deg, #191210 0 5px, #37302a 5px 7px);
}
.ribbon::after {
    /* umgeschlagenes Bandende rechts */
    content: ''; position: absolute; right: 0; top: 0; bottom: 0; width: 10px;
    background: rgba(0, 0, 0, .22);
}
.ribbon:hover, .ribbon:focus-visible { transform: translateX(9px); filter: brightness(1.12); }
.ribbon:focus-visible { outline: 2px dashed var(--creme-hell); outline-offset: -4px; }
.ribbon[aria-current="true"] { transform: translateX(14px); filter: brightness(1.06); }
.ribbon[aria-current="true"] .r-cap { border-bottom: 1px solid rgba(243, 237, 220, .7); }

.r-cap {
    font-family: var(--schreibmaschine);
    font-size: .8rem; letter-spacing: .26em; text-transform: uppercase;
    white-space: nowrap;
}
.r-sub {
    font-family: var(--garamond);
    font-style: italic;
    font-size: .85rem;
    opacity: .78;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.r-hand {
    margin-left: auto;
    font-family: var(--schreibmaschine);
    font-size: .58rem; letter-spacing: .18em; text-transform: uppercase;
    opacity: .5;
    white-space: nowrap;
}

.ribbon.b-qisses   { background-color: #A65A26; }
.ribbon.b-leistung { background-color: var(--oliv); }
.ribbon.b-haltung  { background-color: #5C2A20; }
.ribbon.b-prozess  { background-color: var(--messing); color: #2E2413; }
.ribbon.b-ueber    { background-color: #35291F; }
.ribbon.b-kontakt  { background-color: var(--papier-dunkel); color: var(--tinte); }

/* Ein Band steht kopf — 2006 lässt grüßen */
.ribbon.gedreht { transform: rotate(180deg); }
.ribbon.gedreht:hover, .ribbon.gedreht:focus-visible { transform: rotate(180deg) translateX(-9px); }
.ribbon.gedreht[aria-current="true"] { transform: rotate(180deg) translateX(-14px); }

/* ---------- Die aufgeschlagene Seite ---------- */

#seite {
    position: relative;
    flex: 1;
    min-height: 0;
    background: url('img/seite-papier.webp') no-repeat center / cover;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(41, 34, 27, .45) transparent;
}
#seite::-webkit-scrollbar { width: 7px; }
#seite::-webkit-scrollbar-thumb { background: rgba(41, 34, 27, .4); }

.blatt {
    display: none;
    padding: clamp(26px, 4.5%, 46px) clamp(26px, 6%, 64px) clamp(36px, 5%, 56px) clamp(58px, 9%, 92px);
}
.blatt.offen { display: block; }

/* Typo im Blatt */
.blatt-label {
    font-family: var(--schreibmaschine);
    font-size: .66rem; letter-spacing: .28em; text-transform: uppercase;
    color: var(--rost);
    margin-bottom: 14px;
}
.blatt h2 {
    font-family: var(--fell);
    font-weight: 400;
    font-size: clamp(1.7rem, 3.4vw, 2.5rem);
    line-height: 1.1;
    margin-bottom: 18px;
}
.blatt h3 {
    font-family: var(--fell);
    font-weight: 400;
    font-size: 1.32rem;
    margin-bottom: 6px;
}
.blatt p { max-width: 62ch; margin-bottom: 14px; color: var(--tinte); }
.blatt p strong { font-weight: 650; }
.blatt p em { font-style: italic; }
.blatt a { color: var(--rost); text-decoration: underline; text-underline-offset: 3px; }
.blatt a:focus-visible { outline: 2px dashed var(--rost); outline-offset: 3px; }

.tinten-linie {
    border: none;
    height: 14px;
    margin: 8px 0 22px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 14' preserveAspectRatio='none'%3E%3Cpath d='M2 8 C 60 4, 120 11, 190 7 S 280 6, 298 9' stroke='%239A3B1E' stroke-width='1.6' fill='none' opacity='.75'/%3E%3C/svg%3E") no-repeat left center / 240px 14px;
}

/* Startblatt */
.wortmarke {
    font-family: var(--fell);
    font-weight: 400;
    font-size: clamp(3rem, 8vw, 5.4rem);
    line-height: 1;
    margin: 6px 0 4px;
}
.wortmarke .punkt { color: var(--honig); }
.start-unterzeile {
    font-family: var(--schreibmaschine);
    font-size: .72rem; letter-spacing: .3em; text-transform: uppercase;
    color: var(--tinte-blass);
    margin-bottom: 26px;
}
.start-zitat {
    font-family: var(--garamond);
    font-style: italic;
    color: var(--tinte-blass);
    margin-top: 26px;
    font-size: .95rem;
}

/* Stempel-Buttons & -Chips */
.stempel {
    display: inline-block;
    font-family: var(--schreibmaschine);
    font-size: .82rem; letter-spacing: .2em; text-transform: uppercase;
    color: var(--rost);
    background: transparent;
    border: 2px solid var(--rost);
    border-radius: 3px;
    padding: 12px 22px 10px;
    margin: 8px 0;
    cursor: pointer;
    text-decoration: none !important;
    transform: rotate(-1.2deg);
    box-shadow: inset 0 0 12px rgba(154, 59, 30, .12);
    transition: transform .2s ease, background .2s ease, color .2s ease;
}
a.stempel { color: var(--rost); }
.stempel:hover, .stempel:focus-visible {
    background: var(--rost); color: var(--papier);
    transform: rotate(-1.2deg) scale(1.03);
}
.stempel:focus-visible { outline: 2px dashed var(--rost); outline-offset: 4px; }

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 26px; padding: 0; }
.chips li {
    font-family: var(--schreibmaschine);
    font-size: .6rem; letter-spacing: .16em; text-transform: uppercase;
    color: var(--tinte-blass);
    border: 1px solid rgba(41, 34, 27, .4);
    border-radius: 2px;
    padding: 5px 9px 3px;
    transform: rotate(-.6deg);
}
.chips li:nth-child(2n) { transform: rotate(.8deg); }

/* Leistungs-Einträge */
.eintrag { margin-bottom: 34px; }
.eintrag .blatt-label { margin-bottom: 4px; }

/* Haltung: eingekreiste Randnotizen */
.notizen { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 28px; }
.notiz { flex: 1 1 180px; min-width: 160px; }
.notiz dt {
    display: inline-block;
    font-family: var(--fell);
    font-size: 1.5rem;
    padding: 10px 20px;
    border: 2px solid var(--rost);
    border-radius: 50%;
    transform: rotate(-2deg);
    color: var(--rost);
    margin-bottom: 8px;
}
.notiz:nth-child(2) dt { transform: rotate(1.6deg); }
.notiz dd { font-size: .92rem; color: var(--tinte-blass); }

/* Prozess: Kontobuch-Zeilen (echte Sequenz => Nummern erlaubt) */
.kontobuch { list-style: none; counter-reset: schritt; padding: 0; margin-top: 10px; }
.kontobuch li {
    counter-increment: schritt;
    position: relative;
    padding: 16px 0 14px 74px;
    border-bottom: 1px solid rgba(41, 34, 27, .22);
}
.kontobuch li::before {
    content: counter(schritt, decimal-leading-zero) '.';
    position: absolute; left: 6px; top: 14px;
    font-family: var(--fell);
    font-size: 1.7rem;
    color: var(--rost);
}
.kontobuch h3 { margin-bottom: 2px; }
.kontobuch p { margin: 0; font-size: .95rem; }

/* Über uns: Passbuch-Fakten */
.passbuch { display: flex; flex-wrap: wrap; gap: 10px 26px; margin: 22px 0; }
.passbuch div { flex: 0 1 auto; }
.passbuch dt {
    font-family: var(--schreibmaschine);
    font-size: .58rem; letter-spacing: .22em; text-transform: uppercase;
    color: var(--tinte-blass);
}
.passbuch dd { font-family: var(--fell); font-size: 1.1rem; }

/* Kontakt */
.kontakt-gross { font-size: clamp(2.2rem, 5vw, 3.4rem) !important; }
.kontakt-note { font-style: italic; color: var(--tinte-blass); font-size: .95rem; }

/* Impressum / Datenschutz */
.legal h3 { font-size: 1.05rem; margin-top: 20px; }
.legal p { font-size: .92rem; }

/* ---------- Unterzeile & Seitentexte auf der Tapete ---------- */

#unterzeile {
    position: fixed; z-index: 3;
    left: 0; right: 0; bottom: 7px;
    text-align: center;
    font-family: var(--schreibmaschine);
    font-size: .6rem; letter-spacing: .18em; text-transform: uppercase;
    color: rgba(233, 226, 207, .5);
}
#unterzeile button, #unterzeile a {
    font: inherit; letter-spacing: inherit; text-transform: inherit;
    color: rgba(233, 226, 207, .72);
    background: none; border: none; cursor: pointer;
    text-decoration: underline; text-underline-offset: 3px;
}
#unterzeile button:hover, #unterzeile a:hover,
#unterzeile button:focus-visible, #unterzeile a:focus-visible { color: var(--creme-hell); }
#unterzeile .trenner { opacity: .4; margin: 0 7px; }

#ambience {
    position: fixed; z-index: 3;
    left: 14px; top: 50%;
    transform: translateY(-50%) rotate(180deg);
    writing-mode: vertical-rl;
    font-family: var(--schreibmaschine);
    font-size: .62rem; letter-spacing: .34em; text-transform: uppercase;
    color: rgba(233, 226, 207, .55);
    background: none; border: none; cursor: pointer;
    padding: 10px 4px;
}
#ambience:hover, #ambience:focus-visible { color: var(--creme-hell); }
#ambience .an { color: var(--honig); }

#deko-rechts {
    position: fixed; z-index: 3;
    right: 14px; top: 50%;
    transform: translateY(-50%);
    writing-mode: vertical-rl;
    font-family: var(--schreibmaschine);
    font-size: .58rem; letter-spacing: .34em; text-transform: uppercase;
    color: rgba(233, 226, 207, .32);
    pointer-events: none;
}

/* ---------- Die Fliege ---------- */

#fliege {
    position: absolute; z-index: 40;
    top: 0; left: 0;
    width: 34px; height: 47px;
    pointer-events: none;
    will-change: transform;
}
#fliege img {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
}
#fliege .frame-flug { display: none; width: 133%; left: -16%; }
#fliege.fliegt .frame-flug { display: block; }
#fliege.fliegt .frame-ruhe { display: none; }
#fliegen-schatten {
    position: absolute; z-index: 39;
    top: 0; left: 0;
    width: 26px; height: 14px;
    background: radial-gradient(ellipse at center, rgba(30, 20, 10, .3), transparent 70%);
    pointer-events: none;
    will-change: transform;
}

/* ---------- Responsive ---------- */

@media (max-width: 720px) {
    html, body { overflow-x: hidden; }
    body { overflow-y: auto; }
    #buehne { position: relative; min-height: 100dvh; padding: 12px 0 30px; align-items: flex-start; }
    #block {
        width: calc(100vw - 16px);
        height: auto;
        min-height: calc(100dvh - 60px);
        transform: none;
        margin: 0 auto;
    }
    #kopfblatt { height: 175px; }
    .kopf-text { width: 58%; right: 4%; }
    .kopf-zitat { display: none; }
    #seite { overflow: visible; }
    .blatt { padding: 24px 20px 34px 52px; }
    .ribbon { padding: 8px 14px 6px 44px; gap: 10px; }
    .r-sub { display: none; }
    .r-hand { display: none; }
    #ambience {
        position: fixed; left: auto; right: 8px; top: auto; bottom: 12px;
        transform: none; writing-mode: horizontal-tb;
        z-index: 50;
        background: rgba(43, 11, 14, .85);
        border: 1px solid rgba(233, 226, 207, .3);
        padding: 8px 12px 6px;
    }
    #deko-rechts { display: none; }
    #unterzeile { position: static; padding: 14px 10px 6px; }
}

@media (max-height: 560px) and (min-width: 721px) {
    #kopfblatt { height: 140px; }
}

/* ---------- Reduzierte Bewegung ---------- */

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}

/* ---------- Kein JavaScript ---------- */

.no-js #lade { display: none; }
.no-js body { overflow: auto; }
.no-js #buehne { position: relative; }
.no-js .blatt { display: block; border-bottom: 2px solid rgba(41, 34, 27, .3); }
