/* ===== 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-dark-overlay: rgba(35, 28, 20, 0.85);
    --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);
    --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: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== HERO ===== */
.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); }
}

/* ===== DECORATIVE DIVIDER ===== */
.info-section::before {
    content: '✦  ✦  ✦';
    display: block;
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-light);
    letter-spacing: 0.5em;
    margin-bottom: 60px;
    opacity: 0.6;
}

/* ===== INFO SECTION ===== */
.info-section {
    position: relative;
    padding: 80px 0 100px;
}

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

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

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 18px;
}

.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    padding: 30px 26px;
    transition: var(--transition);
    backdrop-filter: blur(8px);
    animation: fadeInUp 0.6s ease-out calc(var(--delay) * 0.1s) both;
}

.info-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-card-hover);
    transform: translateY(-3px);
    box-shadow: var(--shadow-card);
}

.card-icon {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    font-style: italic;
    color: var(--accent-1);
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(139, 69, 19, 0.2);
    border-radius: 50%;
    margin-bottom: 16px;
    letter-spacing: 0.02em;
}

.info-card h3 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.info-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ===== 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;
}

.section-desc {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.02rem;
    margin-top: -36px;
    margin-bottom: 44px;
}

.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: 540px;
}

.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;
}

/* ===== BACKGROUND PARTICLES - hidden in this theme ===== */
.bg-particles {
    display: none;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .cards-grid {
        grid-template-columns: 1fr;
    }

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

    .message {
        max-width: 92%;
    }

    .hero {
        padding: 60px 20px;
    }
}

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

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

/* ===== 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);
}
