:root {
    --bg-color: #ffffff;
    --secondary-bg: #f5f5f7;
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --accent: #0071e3;
    --border-color: #e8e8ed;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --max-width: 980px;
    --transition-smooth: cubic-bezier(0.25, 1, 0.5, 1);
}

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

html {
    scroll-behavior: smooth;
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1; /* Schiebt den Footer nach unten */
}

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 40px;
}

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 48px;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    z-index: 1000;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: var(--max-width);
    height: 100%;
    margin: 0 auto;
    padding: 0 40px;
}

.nav-logo {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.01em;
}

.nav-links a {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s var(--transition-smooth);
}

.nav-links a.active-nav {
    color: var(--text-primary);
}

.overview-section {
    padding-top: 140px;
    padding-bottom: 120px;
}

.welcome-title {
    font-size: 44px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 56px;
}

/* ---------------------------------------------------------------------
   Neu gestaltete Link-Boxen (Book-Cards) nach Apple-Vorbild
--------------------------------------------------------------------- */
.book-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    border-top: 1px solid var(--border-color);
}

.book-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 32px 0;
    border-bottom: 1px solid var(--border-color);
    text-decoration: none;
    background: transparent;
    transition: transform 0.3s var(--transition-smooth);
}

.book-title {
    font-size: 22px;
    font-weight: 400;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    transition: color 0.3s var(--transition-smooth), transform 0.3s var(--transition-smooth);
}

.book-arrow {
    font-size: 22px;
    color: var(--text-secondary);
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.3s var(--transition-smooth), transform 0.3s var(--transition-smooth);
}

.book-card:hover .book-title {
    color: var(--accent);
    transform: translateX(8px);
}

.book-card:hover .book-arrow {
    opacity: 1;
    transform: translateX(0);
    color: var(--accent);
}

/* ---------------------------------------------------------------------
   Reader & Text-Layout
--------------------------------------------------------------------- */
.reader-main {
    padding-top: 140px;
    padding-bottom: 60px;
}

.reader-container {
    max-width: var(--reader-max-width);
}

.paper-page {
    width: 100%;
    height: 58vh;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.reader-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

#story-title {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

#story-text {
    flex-grow: 1;
    overflow: hidden;
}

#story-text p {
    font-size: 17px;
    line-height: 1.65;
    color: #333336;
    margin-bottom: 20px;
    font-weight: 400;
}

#story-text h1, #story-text h2, #story-text h3 {
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-top: 24px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

#story-text h1 { font-size: 26px; }
#story-text h2 { font-size: 22px; }
#story-text h3 { font-size: 19px; }

#story-text ul, #story-text ol {
    padding-left: 24px;
    margin-bottom: 20px;
}

#story-text li {
    font-size: 17px;
    line-height: 1.6;
    color: #333336;
    margin-bottom: 8px;
}

.navigation {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 40px;
    margin-bottom: 40px;
}

.nav-arrow {
    background-color: var(--secondary-bg);
    border: none;
    color: var(--text-primary);
    font-size: 16px;
    width: 56px;
    height: 36px;
    border-radius: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s var(--transition-smooth);
}

.nav-arrow:hover {
    background-color: #ededf0;
}

.nav-arrow:disabled {
    opacity: 0.25;
    cursor: not-allowed;
}

.back-link-container {
    text-align: center;
}

.back-link {
    font-size: 14px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s var(--transition-smooth);
}

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

#height-checker-container {
    position: absolute;
    top: -9999px;
    left: -9999px;
    width: 100%;
}

#height-checker {
    position: absolute;
    visibility: hidden;
    height: auto;
}

#height-checker p {
    font-size: 17px;
    line-height: 1.65;
    margin-bottom: 20px;
}

#height-checker h1 { font-size: 26px; }
#height-checker h2 { font-size: 22px; }
#height-checker h3 { font-size: 19px; }

.page-turn-next {
    opacity: 0;
    transform: translateY(4px);
}

.page-turn-prev {
    opacity: 0;
    transform: translateY(-4px);
}

/* ---------------------------------------------------------------------
   Footer (Gleich wie im Portfolio)
--------------------------------------------------------------------- */
.footer {
    padding: 60px 0;
    font-size: 12px;
    color: var(--text-secondary);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-right {
    display: flex;
    gap: 24px;
    align-items: center;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s var(--transition-smooth);
}

.footer-link:hover {
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .container {
        padding: 0 24px;
    }

    .nav-container {
        padding: 0 24px;
    }

    .overview-section {
        padding-top: 100px;
        padding-bottom: 60px;
    }

    .welcome-title {
        font-size: 32px;
        margin-bottom: 32px;
    }

    .book-card {
        padding: 24px 0;
    }

    .book-title {
        font-size: 18px;
    }
    
    .book-arrow {
        opacity: 1;
        transform: translateX(0);
        font-size: 18px;
    }

    .reader-main {
        padding-top: 100px;
    }

    .paper-page {
        height: 52vh;
        min-height: 340px;
    }

    #story-text p, #story-text li {
        font-size: 16px;
    }

    .footer-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}
