/* ===== RESET & BASE ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-paper: #f5f0e8;
    --bg-card: rgba(255, 255, 255, 0.45);
    --bg-card-hover: rgba(255, 255, 255, 0.65);
    --bg-alt: rgba(139, 69, 19, 0.03);
    --border-card: rgba(120, 90, 50, 0.15);
    --border-card-hover: rgba(120, 90, 50, 0.3);
    --text-primary: #2c2418;
    --text-secondary: #5a4e3c;
    --text-muted: #8c7e6a;
    --text-light: #b8a88a;
    --accent-1: #8b4513;
    --accent-2: #a0522d;
    --accent-3: #6b3410;
    --accent-warm: #c17a3a;
    --accent-gradient: linear-gradient(135deg, #8b4513, #a0522d, #c17a3a);
    --accent-green: #5a7a3a;
    --accent-green-light: rgba(90, 122, 58, 0.1);
    --chat-user-bg: linear-gradient(135deg, #8b4513, #a0522d);
    --chat-bot-bg: rgba(255, 255, 255, 0.5);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 22px;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --shadow-soft: 0 2px 20px rgba(100, 70, 30, 0.08);
    --shadow-card: 0 4px 30px rgba(100, 70, 30, 0.1);
    --shadow-heavy: 0 12px 50px rgba(80, 50, 20, 0.15);
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-paper);
    background-image: url('https://datajournal.org/schon-wieder/paper.webp');
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== NAVBAR ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(245, 240, 232, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(120, 90, 50, 0.1);
    transform: translateY(-100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                background 0.3s ease,
                box-shadow 0.3s ease;
}

.navbar.visible {
    transform: translateY(0);
}

.navbar.scrolled {
    background: rgba(245, 240, 232, 0.95);
    box-shadow: 0 2px 20px rgba(100, 70, 30, 0.08);
}

.navbar-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--accent-1);
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: var(--transition);
}

.navbar-brand:hover {
    color: var(--accent-3);
}

.navbar-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.navbar-link {
    font-size: 0.76rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    transition: var(--transition);
    letter-spacing: 0.02em;
    position: relative;
}

.navbar-link:hover {
    color: var(--accent-1);
    background: rgba(139, 69, 19, 0.06);
}

.navbar-link.active {
    color: var(--accent-1);
    font-weight: 600;
    background: rgba(139, 69, 19, 0.08);
}

/* Mobile hamburger */
.navbar-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 6px;
    background: none;
    border: none;
    cursor: pointer;
}

.navbar-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--accent-1);
    border-radius: 2px;
    transition: var(--transition);
}

.navbar-toggle.open span:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}

.navbar-toggle.open span:nth-child(2) {
    opacity: 0;
}

.navbar-toggle.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.navbar-mobile {
    display: none;
    flex-direction: column;
    padding: 8px 24px 16px;
    border-top: 1px solid rgba(120, 90, 50, 0.08);
}

.navbar-mobile.open {
    display: flex;
}

.navbar-mobile .navbar-link {
    padding: 10px 12px;
    font-size: 0.85rem;
}
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 24px;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(139, 69, 19, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 780px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    background: rgba(139, 69, 19, 0.08);
    border: 1px solid rgba(139, 69, 19, 0.15);
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-1);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 36px;
    animation: fadeInDown 0.8s ease-out;
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #6b8e23;
    animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(107, 142, 35, 0.4); }
    50% { opacity: 0.7; box-shadow: 0 0 0 6px rgba(107, 142, 35, 0); }
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.8rem, 7vw, 5.2rem);
    font-weight: 800;
    line-height: 1.08;
    margin-bottom: 28px;
    color: var(--text-primary);
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero-title-accent {
    display: block;
    color: var(--accent-1);
    font-style: italic;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.15rem);
    color: var(--text-secondary);
    max-width: 540px;
    margin: 0 auto 44px;
    line-height: 1.75;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 32px;
    background: var(--accent-1);
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    transition: var(--transition);
    box-shadow: 0 2px 12px rgba(139, 69, 19, 0.2);
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

.hero-cta:hover {
    background: var(--accent-3);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(139, 69, 19, 0.3);
}

.hero-cta:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(139, 69, 19, 0.2);
}

.hero-scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    animation: fadeInUp 1s ease-out 1s both;
}

.scroll-line {
    width: 2px;
    height: 36px;
    background: linear-gradient(to bottom, var(--accent-1), transparent);
    border-radius: 2px;
    opacity: 0.4;
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.4; height: 36px; }
    50% { opacity: 0.15; height: 20px; }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== PART NAVIGATION (sticky dots) ===== */
.part-nav {
    position: fixed;
    top: 50%;
    right: 28px;
    transform: translateY(-50%);
    z-index: 100;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.part-nav.visible {
    opacity: 1;
    pointer-events: all;
}

.nav-track {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.nav-dot {
    position: relative;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
}

.nav-dot-inner {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-light);
    border: 2px solid var(--bg-paper);
    transition: var(--transition);
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.nav-dot.active .nav-dot-inner,
.nav-dot:hover .nav-dot-inner {
    background: var(--accent-1);
    transform: scale(1.3);
    box-shadow: 0 0 0 4px rgba(139, 69, 19, 0.15);
}

.nav-label {
    position: absolute;
    right: 38px;
    white-space: nowrap;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    background: rgba(255,255,255,0.9);
    padding: 3px 10px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    opacity: 0;
    transform: translateX(8px);
    transition: var(--transition);
    pointer-events: none;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.nav-dot:hover .nav-label {
    opacity: 1;
    transform: translateX(0);
}

.nav-line {
    width: 2px;
    height: 18px;
    background: rgba(139, 69, 19, 0.12);
}

/* ===== AUDIO SECTIONS ===== */
.audio-section {
    position: relative;
    padding: 80px 0;
}

.audio-section.alt-bg {
    background: var(--bg-alt);
}

.audio-section::before {
    content: '✦  ✦  ✦';
    display: block;
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-light);
    letter-spacing: 0.5em;
    margin-bottom: 40px;
    opacity: 0.6;
}

.part-header {
    text-align: center;
    margin-bottom: 40px;
}

.part-number {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--accent-1);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 800;
    text-align: center;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.section-title::after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background: var(--accent-gradient);
    margin: 14px auto 0;
    border-radius: 2px;
}

.section-desc {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 8px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
}

/* ===== AUDIO CARD ===== */
.audio-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-xl);
    overflow: hidden;
    backdrop-filter: blur(8px);
    box-shadow: var(--shadow-card);
    transition: var(--transition);
}

.audio-card:hover {
    border-color: var(--border-card-hover);
    box-shadow: var(--shadow-heavy);
}

.audio-player-wrap {
    padding: 28px 28px 20px;
}

.player-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent-1);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.audio-player {
    width: 100%;
    height: 44px;
    border-radius: 8px;
    outline: none;
}

/* Style native audio player */
audio::-webkit-media-controls-panel {
    background: rgba(245, 240, 232, 0.8);
}

/* ===== TRANSCRIPT TOGGLE ===== */
.transcript-toggle {
    border-top: 1px solid var(--border-card);
}

.transcript-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 28px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-main);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
    text-align: left;
}

.transcript-btn:hover {
    background: rgba(139, 69, 19, 0.04);
    color: var(--accent-1);
}

.transcript-btn .chevron {
    margin-left: auto;
    transition: transform 0.3s ease;
}

.transcript-btn[aria-expanded="true"] .chevron {
    transform: rotate(180deg);
}

.transcript-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s ease;
}

.transcript-content.open {
    max-height: 800px;
}

.transcript-text {
    margin: 0 28px 28px;
    padding: 22px 26px;
    background: rgba(139, 69, 19, 0.04);
    border-left: 3px solid var(--accent-warm);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-size: 0.9rem;
    line-height: 1.85;
    color: var(--text-secondary);
    font-style: normal;
}

.transcript-text .speaker {
    display: block;
    font-weight: 700;
    color: var(--accent-1);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
}

.transcript-text strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* ===== WORKSHEET SECTION ===== */
.worksheet-section {
    position: relative;
    padding: 80px 0 100px;
    background: rgba(90, 122, 58, 0.03);
}

.worksheet-section::before {
    content: '✦  ✦  ✦';
    display: block;
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-light);
    letter-spacing: 0.5em;
    margin-bottom: 40px;
    opacity: 0.6;
}

/* ===== WORKSHEET PROGRESS ===== */
.worksheet-progress {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 36px;
    padding: 14px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    backdrop-filter: blur(8px);
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(139, 69, 19, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--accent-gradient);
    border-radius: 3px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-text {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    letter-spacing: 0.02em;
}

/* ===== WORKSHEET CARDS ===== */
.worksheet-cards {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.worksheet-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    padding: 28px;
    backdrop-filter: blur(8px);
    transition: var(--transition);
}

.worksheet-card:hover {
    border-color: var(--border-card-hover);
    box-shadow: var(--shadow-soft);
}

.worksheet-card.completed {
    border-color: rgba(90, 122, 58, 0.3);
    background: rgba(90, 122, 58, 0.04);
}

.q-badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--accent-1);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.q-reference {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 14px;
    padding: 3px 10px;
    background: rgba(139, 69, 19, 0.05);
    border-radius: 4px;
    margin-left: 10px;
}

.q-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 14px;
    line-height: 1.5;
}

.q-hint {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 14px;
    padding: 10px 14px;
    background: rgba(139, 69, 19, 0.04);
    border-radius: var(--radius-sm);
    line-height: 1.6;
}

.q-hint strong {
    color: var(--text-secondary);
}

.q-input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.6);
    font-family: var(--font-main);
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.7;
    resize: vertical;
    transition: var(--transition);
    outline: none;
    min-height: 80px;
}

.q-input::placeholder {
    color: var(--text-light);
}

.q-input:focus {
    border-color: var(--accent-2);
    box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.1);
    background: rgba(255, 255, 255, 0.8);
}

.q-status {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-top: 8px;
    min-height: 18px;
    transition: var(--transition);
}

.q-status.saved {
    color: var(--accent-green);
}

/* ===== CHECK BUTTON & FEEDBACK ===== */
.q-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    min-height: 36px;
}

.check-btn {
    padding: 7px 18px;
    border: 1px solid var(--accent-1);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--accent-1);
    font-family: var(--font-main);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.check-btn:hover:not(:disabled) {
    background: var(--accent-1);
    color: #fff;
    box-shadow: 0 2px 10px rgba(139, 69, 19, 0.2);
}

.check-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    border-color: var(--text-light);
    color: var(--text-light);
}

.check-btn.checking {
    pointer-events: none;
    opacity: 0.6;
}

.q-feedback {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                margin 0.3s ease,
                opacity 0.3s ease;
    opacity: 0;
}

.q-feedback.visible {
    max-height: 400px;
    margin-top: 14px;
    opacity: 1;
}

.feedback-card {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    line-height: 1.75;
    animation: fadeInUp 0.4s ease-out;
}

.feedback-card.correct {
    background: rgba(90, 122, 58, 0.08);
    border-left: 3px solid var(--accent-green);
    color: #3d5a1e;
}

.feedback-card.needs-work {
    background: rgba(180, 130, 50, 0.08);
    border-left: 3px solid #c9a03c;
    color: #6b5519;
}

.feedback-card.error {
    background: rgba(180, 60, 40, 0.06);
    border-left: 3px solid #b44028;
    color: #8b3020;
}

.feedback-icon {
    font-size: 1rem;
    margin-right: 6px;
}

.feedback-label {
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 6px;
    display: block;
}

/* ===== CHAT SECTION ===== */
.chat-section {
    position: relative;
    padding: 20px 0 120px;
}

.chat-section::before {
    content: '✦  ✦  ✦';
    display: block;
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-light);
    letter-spacing: 0.5em;
    margin-bottom: 40px;
    opacity: 0.6;
}

.chat-container {
    max-width: 740px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-heavy);
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    height: 480px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    scroll-behavior: smooth;
}

/* Scrollbar */
.chat-messages::-webkit-scrollbar {
    width: 5px;
}
.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}
.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(139, 69, 19, 0.15);
    border-radius: 3px;
}
.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 69, 19, 0.3);
}

/* Messages */
.message {
    display: flex;
    gap: 12px;
    max-width: 85%;
    animation: messageIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes messageIn {
    from { opacity: 0; transform: translateY(10px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.bot-message {
    align-self: flex-start;
}

.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 700;
    flex-shrink: 0;
    letter-spacing: 0.02em;
}

.bot-message .message-avatar {
    background: var(--accent-gradient);
    color: #fff;
}

.user-message .message-avatar {
    background: rgba(139, 69, 19, 0.1);
    color: var(--accent-1);
    font-size: 0.85rem;
}

.message-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.message-bubble {
    padding: 13px 17px;
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
    line-height: 1.65;
    word-wrap: break-word;
}

.bot-message .message-bubble {
    background: var(--chat-bot-bg);
    border: 1px solid var(--border-card);
    border-top-left-radius: 4px;
    color: var(--text-primary);
}

.user-message .message-bubble {
    background: var(--chat-user-bg);
    border-top-right-radius: 4px;
    color: #fff;
}

.message-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    padding: 0 4px;
}

.user-message .message-time {
    text-align: right;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 0;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: typingBounce 1.4s ease-in-out infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.3; }
    30% { transform: translateY(-5px); opacity: 0.8; }
}

/* Chat Input */
.chat-input-area {
    padding: 14px 18px 18px;
    border-top: 1px solid var(--border-card);
    background: rgba(255, 255, 255, 0.3);
}

.chat-form {
    display: flex;
}

.input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--border-card);
    border-radius: 8px;
    padding: 4px 6px 4px 16px;
    transition: var(--transition);
}

.input-wrapper:focus-within {
    border-color: var(--accent-2);
    box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.1);
    background: rgba(255, 255, 255, 0.8);
}

#chatInput {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.9rem;
    padding: 10px 0;
}

#chatInput::placeholder {
    color: var(--text-light);
}

.send-btn {
    width: 38px;
    height: 38px;
    border-radius: 6px;
    border: none;
    background: var(--accent-1);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.send-btn:hover {
    background: var(--accent-3);
    transform: scale(1.03);
}

.send-btn:active {
    transform: scale(0.95);
}

.send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.chat-disclaimer {
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 10px;
    font-style: italic;
}

/* ===== FOOTER ===== */
.footer {
    position: relative;
    text-align: center;
    padding: 36px 24px;
    border-top: 1px solid var(--border-card);
}

.footer p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.footer-small {
    margin-top: 6px;
    font-size: 0.72rem !important;
    color: var(--text-muted) !important;
}

.footer-link {
    color: var(--accent-1);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.footer-link:hover {
    color: var(--accent-3);
    text-decoration: underline;
}

/* ===== INTERSECTION OBSERVER REVEAL ===== */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .part-nav {
        display: none;
    }
}

@media (max-width: 768px) {
    .navbar-links {
        display: none;
    }

    .navbar-toggle {
        display: flex;
    }

    .chat-container {
        height: 420px;
        border-radius: var(--radius-lg);
    }

    .message {
        max-width: 92%;
    }

    .hero {
        padding: 60px 20px;
    }

    .audio-player-wrap {
        padding: 20px 20px 16px;
    }

    .transcript-btn {
        padding: 14px 20px;
    }

    .transcript-text {
        margin: 0 20px 20px;
        padding: 18px 20px;
    }

    .worksheet-card {
        padding: 22px 20px;
    }

    .q-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .chat-container {
        height: 380px;
    }

    .hero-badge {
        font-size: 0.65rem;
        padding: 6px 14px;
    }

    .q-reference {
        display: flex;
        margin-left: 0;
        margin-top: 4px;
    }
}
