/* Engemann Academic Website — Apple-Style Design System */

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

:root {
    --apple-black: #1d1d1f;
    --apple-gray: #86868b;
    --apple-bg: #f5f5f7;
    --apple-link: #06c;
    --apple-link-hover: #0071e3;
    --apple-white: #fff;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--apple-black);
    background: var(--apple-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

/* ---- Typography ---- */
h1, h2, h3, h4 {
    font-family: var(--font-sans);
    color: var(--apple-black);
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

/* ---- Navigation ---- */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    transition: background 0.3s, box-shadow 0.3s;
}

.site-nav.scrolled {
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 0.5px 0 rgba(0, 0, 0, 0.1);
}

.nav-inner {
    max-width: 980px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--apple-black);
    letter-spacing: -0.02em;
    transition: opacity 0.2s;
}
.nav-brand:hover { opacity: 0.7; }

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links a {
    font-size: 0.8125rem;
    color: var(--apple-black);
    opacity: 0.8;
    transition: opacity 0.2s;
}
.nav-links a:hover { opacity: 1; }
.nav-links a.active { opacity: 1; font-weight: 500; }

.nav-lang {
    font-size: 0.8125rem;
    color: var(--apple-gray);
    margin-left: 0.5rem;
}
.nav-lang a { transition: opacity 0.2s; }
.nav-lang a:hover { opacity: 0.7; }
.nav-lang .current { color: var(--apple-black); font-weight: 500; }

/* ---- Sections ---- */
.section-white {
    background: var(--apple-white);
}

.section-gray {
    background: var(--apple-bg);
}

.container {
    max-width: 980px;
    margin: 0 auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

/* ---- Hero ---- */
.hero {
    padding: 8rem 0 6rem;
    text-align: center;
}

.hero-portrait {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 2.5rem;
    background: var(--apple-bg);
}
.hero-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.3125rem;
    color: var(--apple-gray);
    line-height: 1.5;
    max-width: 600px;
    margin: 0 auto 2.5rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

@media (min-width: 768px) {
    .hero {
        padding: 10rem 0 8rem;
    }
    .hero h1 {
        font-size: 4.5rem;
    }
    .hero-portrait {
        width: 200px;
        height: 200px;
    }
}

/* ---- Buttons ---- */
.btn {
    display: inline-block;
    font-size: 1.0625rem;
    font-weight: 400;
    padding: 0.75rem 1.75rem;
    border-radius: 980px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, transform 0.1s;
    border: none;
    text-align: center;
}
.btn:active { transform: scale(0.98); }

.btn-primary {
    background: var(--apple-black);
    color: var(--apple-white);
}
.btn-primary:hover {
    background: #333336;
}

.btn-secondary {
    background: transparent;
    color: var(--apple-link);
    border: 1px solid var(--apple-link);
}
.btn-secondary:hover {
    background: var(--apple-link);
    color: var(--apple-white);
}

/* ---- Research Cards ---- */
.research-section {
    padding: 6rem 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 3.5rem;
    letter-spacing: -0.03em;
}

.research-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .research-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.research-card {
    background: var(--apple-white);
    border-radius: 18px;
    padding: 2rem;
    box-shadow: 2px 4px 12px rgba(0, 0, 0, 0.04);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.research-card:hover {
    transform: translateY(-4px);
    box-shadow: 2px 8px 24px rgba(0, 0, 0, 0.08);
}

.research-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.research-card p {
    font-size: 0.9375rem;
    color: var(--apple-gray);
    line-height: 1.5;
}

/* ---- Publications ---- */
.publications-section {
    padding: 6rem 0;
}

.publications-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 3rem;
}

.publications-header .section-title {
    text-align: left;
    margin-bottom: 0;
}

.view-all-link {
    font-size: 1.0625rem;
    color: var(--apple-link);
    transition: color 0.2s;
}
.view-all-link:hover {
    color: var(--apple-link-hover);
    text-decoration: underline;
}

/* ---- Publication cards (list + homepage) ---- */
.pub-card {
    display: flex;
    align-items: flex-start;
    text-decoration: none;
    color: inherit;
    border-radius: 12px;
    transition: background 0.2s;
}
.pub-card:hover { background: var(--apple-bg); }

/* Rich card (with cover) */
.pub-card--rich {
    gap: 1.5rem;
    padding: 1.25rem;
    margin: 0 -1.25rem;
}
.pub-card__cover {
    flex-shrink: 0;
    width: 100px;
}
.pub-card__cover img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.04);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.pub-card--rich:hover .pub-card__cover img {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15), 0 0 0 0.5px rgba(0, 0, 0, 0.06);
}

/* Text-only card (articles/chapters without cover) */
.pub-card--text {
    padding: 1rem 1.25rem;
    margin: 0 -1.25rem;
    justify-content: space-between;
    align-items: center;
}
.pub-card--text + .pub-card--text {
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}
.pub-card__arrow {
    flex-shrink: 0;
    font-size: 1.125rem;
    color: var(--apple-gray);
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity 0.2s, transform 0.2s;
}
.pub-card--text:hover .pub-card__arrow {
    opacity: 1;
    transform: translateX(0);
}

.pub-card__info { flex: 1; min-width: 0; }

.pub-card__title {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--apple-black);
    letter-spacing: -0.01em;
    line-height: 1.35;
    margin: 0;
}
.pub-card__meta {
    font-size: 0.8125rem;
    color: var(--apple-gray);
    margin: 0.25rem 0 0;
    line-height: 1.4;
}

/* ---- Chat CTA ---- */
.cta-section {
    padding: 8rem 0;
    text-align: center;
}

.cta-section h2 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.cta-text {
    font-size: 1.125rem;
    color: var(--apple-gray);
    max-width: 500px;
    margin: 0 auto 2.5rem;
    line-height: 1.5;
}

/* ---- Footer ---- */
.site-footer {
    background: var(--apple-bg);
    padding: 1.5rem 0;
}

.footer-inner {
    max-width: 980px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.8125rem;
    color: var(--apple-gray);
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}
.footer-links a {
    color: var(--apple-gray);
    transition: color 0.2s;
}
.footer-links a:hover {
    color: var(--apple-black);
}

/* ---- Scroll Reveal ---- */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ---- Prose (article typography) ---- */
.prose {
    color: #424245;
    font-size: 1.0625rem;
    line-height: 1.8;
}
.prose h1 { font-size: 2.5rem; font-weight: 700; margin: 3rem 0 1rem; letter-spacing: -0.03em; }
.prose h2 { font-size: 1.75rem; font-weight: 600; margin: 2.5rem 0 0.75rem; letter-spacing: -0.02em; }
.prose h3 { font-size: 1.25rem; font-weight: 600; margin: 2rem 0 0.5rem; }
.prose p { margin-bottom: 1.25rem; }
.prose a { color: var(--apple-link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.prose a:hover { color: var(--apple-link-hover); }
.prose ul, .prose ol { margin-bottom: 1.25rem; padding-left: 1.5rem; }
.prose li { margin-bottom: 0.375rem; }
.prose li::marker { color: var(--apple-gray); }
.prose blockquote {
    border-left: 3px solid #d2d2d7;
    padding-left: 1.25rem;
    color: var(--apple-gray);
    margin: 1.5rem 0;
    font-style: italic;
}
.prose code { background: var(--apple-bg); padding: 0.125rem 0.375rem; border-radius: 4px; font-size: 0.875em; }
.prose pre { background: var(--apple-black); color: #e5e7eb; padding: 1.25rem; border-radius: 12px; overflow-x: auto; margin: 1.5rem 0; }
.prose pre code { background: none; padding: 0; }
.prose img { max-width: 100%; height: auto; border-radius: 12px; margin: 1.5rem 0; }

/* ---- Page Layouts ---- */
.page-header {
    padding: 5rem 0 3rem;
    text-align: center;
}

.page-header h1 {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.page-header .subtitle {
    font-size: 1.1875rem;
    color: var(--apple-gray);
    margin-top: 0.75rem;
}

.page-content {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 1.5rem 6rem;
}

/* ---- Publication list ---- */
.pub-list-section {
    padding: 0 0 6rem;
}
.pub-list-section .container {
    max-width: 780px;
}
.pub-group {
    margin-bottom: 3rem;
}
.pub-group-title {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--apple-gray);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
.pub-group-items {
    display: flex;
    flex-direction: column;
}

/* ---- Publication detail ---- */
.pub-detail {
    max-width: 740px;
    margin: 0 auto;
    padding: 5rem 1.5rem 6rem;
}

/* Hero: Cover + Meta */
.pub-hero {
    display: flex;
    gap: 2.5rem;
    align-items: flex-start;
    margin-bottom: 3rem;
}
.pub-cover {
    flex-shrink: 0;
    width: 220px;
}
.pub-cover img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.06),
        0 4px 16px rgba(0, 0, 0, 0.1),
        0 12px 40px rgba(0, 0, 0, 0.08);
}
.pub-hero-text {
    flex: 1;
    min-width: 0;
    padding-top: 0.25rem;
}
.pub-hero-text h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.15;
    margin-bottom: 0.875rem;
}
.pub-authors {
    font-size: 1.0625rem;
    color: #424245;
    margin-bottom: 0.625rem;
}
.pub-imprint {
    font-size: 0.875rem;
    color: var(--apple-gray);
    line-height: 1.5;
}
.pub-sep { color: #d2d2d7; }
.pub-ids {
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}
.pub-ids span {
    font-size: 0.8125rem;
    color: var(--apple-gray);
    font-variant-numeric: tabular-nums;
}
.pub-ids a {
    color: var(--apple-link);
    text-decoration: none;
}
.pub-ids a:hover { text-decoration: underline; }

.pub-parent {
    font-size: 0.875rem;
    color: var(--apple-gray);
    margin-top: 0.75rem;
    line-height: 1.5;
}
.pub-parent em { font-style: italic; }

/* Links as inline text links, not pills */
.pub-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem 1.25rem;
    margin-top: 1.25rem;
}
.pub-links a {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--apple-link);
    text-decoration: none;
    transition: color 0.15s;
}
.pub-links a:hover {
    color: var(--apple-link-hover);
    text-decoration: underline;
}

@media (max-width: 600px) {
    .pub-hero {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .pub-cover { width: 180px; }
    .pub-links { justify-content: center; }
    .pub-hero-text h1 { font-size: 1.625rem; }
    .pub-ids { align-items: center; }
}

/* Blurb — no heading, just elegant text */
.pub-blurb {
    margin-bottom: 2.5rem;
    font-size: 1.0625rem;
    line-height: 1.8;
    color: #424245;
}
.pub-blurb p { margin-bottom: 1rem; }
.pub-blurb p:last-child { margin-bottom: 0; }

/* Body prose */
.pub-body {
    margin-bottom: 2.5rem;
}

/* Table of Contents */
.pub-toc {
    margin-bottom: 2.5rem;
    background: var(--apple-bg);
    border-radius: 12px;
    padding: 0;
}
.pub-toc summary {
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    user-select: none;
}
.pub-toc summary::before {
    content: "▸";
    font-size: 0.75rem;
    color: var(--apple-gray);
    transition: transform 0.2s;
    display: inline-block;
}
.pub-toc[open] summary::before {
    transform: rotate(90deg);
}
.pub-toc summary::-webkit-details-marker { display: none; }
.pub-toc ol {
    padding: 0 1.25rem 1.25rem 2.75rem;
    color: #424245;
    font-size: 0.875rem;
    line-height: 1.8;
    margin: 0;
}
.pub-toc li {
    margin-bottom: 0.125rem;
    padding-left: 0.25rem;
}
.pub-toc li::marker { color: var(--apple-gray); }

/* Reviews */
.pub-reviews {
    margin-bottom: 2.5rem;
}
.pub-review {
    margin: 0 0 1.5rem;
    padding: 0;
}
.pub-review blockquote {
    font-size: 1.0625rem;
    font-style: italic;
    line-height: 1.7;
    color: #424245;
    margin: 0;
    padding: 0;
    border: none;
    quotes: "„" """ "‚" "'";
}
.pub-review blockquote::before { content: open-quote; }
.pub-review blockquote::after { content: close-quote; }
.pub-review figcaption {
    font-size: 0.8125rem;
    color: var(--apple-gray);
    margin-top: 0.375rem;
    font-style: normal;
}
.pub-review figcaption a {
    color: var(--apple-link);
    text-decoration: none;
}
.pub-review figcaption a:hover { text-decoration: underline; }

/* Tags */
.pub-tags {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}
.pub-tags span {
    font-size: 0.75rem;
    padding: 0.3rem 0.75rem;
    border-radius: 980px;
    background: var(--apple-bg);
    color: var(--apple-gray);
}

/* Back link */
.pub-back {
    display: inline-block;
    margin-top: 2rem;
    color: var(--apple-link);
    font-size: 0.9375rem;
    text-decoration: none;
    transition: color 0.15s;
}
.pub-back:hover {
    color: var(--apple-link-hover);
    text-decoration: underline;
}

/* ---- Default list ---- */
.default-list-item {
    padding: 1.5rem 0;
}
.default-list-item + .default-list-item {
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}
.default-list-item h2 {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.3;
}
.default-list-item h2 a {
    color: var(--apple-black);
    transition: color 0.2s;
}
.default-list-item h2 a:hover { color: var(--apple-link); }
.default-list-item p { font-size: 0.9375rem; color: var(--apple-gray); margin-top: 0.375rem; }
.default-list-item time { font-size: 0.8125rem; color: var(--apple-gray); margin-top: 0.25rem; display: block; }

/* ---- Chat Page ---- */
.chat-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: calc(100vh - 52px);
    display: flex;
    flex-direction: column;
}

.chat-hero {
    text-align: center;
    padding: 2rem 0 1.25rem;
}
.chat-hero h1 {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
}
.chat-hero-sub {
    font-size: 0.8125rem;
    color: var(--apple-gray);
}

.chat-container {
    flex: 1;
    background: var(--apple-white);
    border-radius: 16px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 4px 24px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    scroll-behavior: smooth;
}
.chat-messages > * + * { margin-top: 0.875rem; }

/* Welcome state */
.chat-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 1rem;
    color: var(--apple-gray);
}
.chat-welcome-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--apple-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: var(--apple-gray);
}
.chat-welcome p {
    font-size: 0.9375rem;
    line-height: 1.5;
    max-width: 320px;
    margin-bottom: 1.5rem;
}

/* Suggestion chips */
.chat-suggestions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}
.chat-suggestion {
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    padding: 0.5rem 1rem;
    border-radius: 980px;
    border: 1px solid #d2d2d7;
    background: var(--apple-white);
    color: var(--apple-black);
    cursor: pointer;
    transition: all 0.2s;
}
.chat-suggestion:hover {
    background: var(--apple-bg);
    border-color: #b0b0b5;
}

/* Remaining messages warning */
.chat-remaining {
    text-align: center;
    font-size: 0.75rem;
    color: var(--apple-gray);
    margin-top: 0.5rem;
}

/* Input area */
.chat-input-area {
    padding: 0.875rem 1rem;
    background: var(--apple-white);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.chat-form {
    display: flex;
    gap: 0.625rem;
    align-items: center;
}

.chat-input {
    flex: 1;
    padding: 0.625rem 1rem;
    border: none;
    border-radius: 980px;
    font-size: 0.875rem;
    font-family: var(--font-sans);
    outline: none;
    background: var(--apple-bg);
    transition: box-shadow 0.2s, background 0.2s;
}
.chat-input:focus {
    background: var(--apple-white);
    box-shadow: 0 0 0 2px var(--apple-link);
}

.chat-send-btn {
    width: 36px;
    height: 36px;
    background: var(--apple-black);
    color: var(--apple-white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s, transform 0.1s;
}
.chat-send-btn:hover { background: #333336; }
.chat-send-btn:active { transform: scale(0.93); }

/* ---- Chat Bubbles (shared) ---- */
.bubble-user {
    display: flex;
    justify-content: flex-end;
}
.bubble-assistant {
    display: flex;
    justify-content: flex-start;
}
.bubble-user > div {
    background: var(--apple-black);
    color: var(--apple-white);
    border-radius: 20px 20px 6px 20px;
    padding: 0.625rem 1rem;
    max-width: 75%;
    font-size: 0.9375rem;
    line-height: 1.5;
}
.bubble-assistant > div {
    background: var(--apple-bg);
    color: var(--apple-black);
    border-radius: 20px 20px 20px 6px;
    padding: 0.625rem 1rem;
    max-width: 75%;
    font-size: 0.9375rem;
    line-height: 1.5;
}
.bubble-assistant .prose {
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--apple-black);
}
.bubble-assistant .prose p { margin-bottom: 0.5rem; }
.bubble-assistant .prose p:last-child { margin-bottom: 0; }
.bubble-assistant .prose a { color: var(--apple-link); }

.chat-hint {
    color: var(--apple-gray);
    font-size: 0.8125rem;
    line-height: 1.5;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 4px 0;
    align-items: center;
}
.typing-indicator span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #b0b0b5;
    animation: typingBounce 1.4s 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.4; }
    30% { transform: translateY(-4px); opacity: 1; }
}

/* Bubble entrance animation */
@keyframes bubbleIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---- Chat Widget (Floating) ---- */
#chat-widget-button {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--apple-black);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
    transition: transform 0.2s, box-shadow 0.2s;
}
#chat-widget-button:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.22);
}

.chat-widget-wrapper {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 50;
}

#chat-widget-panel {
    position: fixed;
    bottom: 5.5rem;
    right: 1.5rem;
    width: 380px;
    height: 520px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.04), 0 12px 48px rgba(0,0,0,0.14);
    display: none;
    flex-direction: column;
    z-index: 50;
    overflow: hidden;
    animation: panelIn 0.25s ease;
}

#chat-widget-panel.open {
    display: flex;
}

@keyframes panelIn {
    from { opacity: 0; transform: translateY(12px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.widget-header {
    padding: 1rem 1.25rem;
    background: var(--apple-white);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.widget-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.widget-header-left {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.widget-avatar {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: var(--apple-black);
    color: var(--apple-white);
    font-size: 0.6875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.02em;
}

.widget-title {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--apple-black);
    display: block;
    line-height: 1.2;
}

.widget-status {
    font-size: 0.6875rem;
    color: #34c759;
    display: block;
    line-height: 1.2;
}

.widget-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--apple-gray);
    font-size: 1.5rem;
    line-height: 1;
    transition: color 0.2s;
    padding: 0;
}
.widget-close:hover { color: var(--apple-black); }

.widget-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.25rem;
    scroll-behavior: smooth;
}
.widget-messages > * + * { margin-top: 0.75rem; }

.widget-input-area {
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding: 0.75rem 1rem;
    background: var(--apple-bg);
}

.widget-form {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.widget-input {
    flex: 1;
    padding: 0.5rem 0.875rem;
    border: none;
    border-radius: 980px;
    font-size: 0.875rem;
    font-family: var(--font-sans);
    outline: none;
    background: var(--apple-white);
    box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
    transition: box-shadow 0.2s;
}
.widget-input:focus { box-shadow: 0 0 0 2px var(--apple-link); }

.widget-send {
    width: 32px;
    height: 32px;
    background: var(--apple-black);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s, transform 0.1s;
}
.widget-send:hover { background: #333336; }
.widget-send:active { transform: scale(0.92); }

@media (max-width: 480px) {
    #chat-widget-panel {
        width: calc(100vw - 2rem);
        height: calc(100vh - 8rem);
        right: 1rem;
        bottom: 4.5rem;
    }
}

/* ---- About Page ---- */
.about-page {
    max-width: 740px;
    margin: 0 auto;
    padding: 0 1.5rem 6rem;
}

.about-hero {
    padding: 5rem 0 3rem;
}
.about-hero-inner {
    display: flex;
    gap: 2.5rem;
    align-items: center;
}
.about-portrait {
    flex-shrink: 0;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--apple-bg);
}
.about-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.about-intro h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 0.25rem;
}
.about-role {
    font-size: 1.0625rem;
    color: #424245;
    margin-bottom: 0.125rem;
}
.about-affiliation {
    font-size: 0.9375rem;
    color: var(--apple-gray);
    margin-bottom: 0.75rem;
}
.about-bio {
    font-size: 1rem;
    color: #424245;
    line-height: 1.6;
}

@media (max-width: 600px) {
    .about-hero-inner {
        flex-direction: column;
        text-align: center;
    }
    .about-portrait { width: 120px; height: 120px; }
    .about-intro h1 { font-size: 1.625rem; }
}

.about-section {
    margin-bottom: 3rem;
}
.about-section h2 {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--apple-gray);
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.about-areas {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
@media (max-width: 600px) {
    .about-areas { grid-template-columns: 1fr; }
}
.about-area h3 {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 0.375rem;
}
.about-area p {
    font-size: 0.875rem;
    color: var(--apple-gray);
    line-height: 1.55;
}

.about-contact address {
    font-style: normal;
    font-size: 0.9375rem;
    color: #424245;
    line-height: 1.7;
}

/* ---- Utility ---- */
.hidden { display: none; }
.text-center { text-align: center; }
