:root {
    --bg-deep: #1a2430;
    --bg-mid: #243447;
    --bg-lift: #2f4258;
    --ink: #1c2834;
    --ink-soft: #4a5a6a;
    --ink-faint: #6b7c8c;
    --paper: #f3f5f7;
    --paper-edge: rgba(255, 255, 255, 0.08);
    --accent: #9e2a2b;
    --accent-soft: #c44536;
    --accent-wash: rgba(158, 42, 43, 0.08);
    --line: rgba(28, 40, 52, 0.12);
    --font-display: "Fraunces", Georgia, serif;
    --font-body: "Source Sans 3", "Segoe UI", sans-serif;
    --radius: 4px;
    --max: 720px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    line-height: 1.65;
    color: var(--ink);
    min-height: 100vh;
    background:
        radial-gradient(ellipse 90% 55% at 50% -10%, rgba(158, 42, 43, 0.18), transparent 55%),
        radial-gradient(ellipse 70% 40% at 100% 30%, rgba(47, 66, 88, 0.9), transparent 50%),
        radial-gradient(ellipse 60% 50% at 0% 80%, rgba(36, 52, 71, 0.8), transparent 45%),
        linear-gradient(165deg, var(--bg-deep) 0%, var(--bg-mid) 45%, var(--bg-lift) 100%);
    background-attachment: fixed;
}

.container {
    max-width: var(--max);
    margin: 0 auto;
    padding: 3.5rem 1.5rem 4rem;
}

/* Hero sits on the atmosphere - no card */
.header {
    text-align: center;
    padding: 1rem 0 2.75rem;
    animation: rise 0.8s ease-out both;
}

.header .profile-photo {
    width: 148px;
    height: 148px;
    object-fit: cover;
    object-position: center top;
    border-radius: 50%;
    margin-bottom: 1.5rem;
    border: 3px solid rgba(247, 245, 242, 0.35);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.header h1 {
    font-family: var(--font-display);
    color: var(--paper);
    font-size: clamp(2.4rem, 6vw, 3.35rem);
    font-weight: 400;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin-bottom: 0.65rem;
}

.header .subtitle {
    color: rgba(247, 245, 242, 0.72);
    font-size: 1.1rem;
    font-weight: 400;
    letter-spacing: 0.01em;
}

/* One continuous content surface */
.panel {
    background: var(--paper);
    border-radius: 12px;
    padding: 2.5rem 2.25rem 2.75rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
    animation: rise 0.8s ease-out 0.12s both;
}

.panel section + section,
.panel details + section,
.panel section + details {
    margin-top: 2.25rem;
    padding-top: 2.25rem;
    border-top: 1px solid var(--line);
}

.panel h2 {
    font-family: var(--font-display);
    color: var(--ink);
    font-size: 1.55rem;
    font-weight: 500;
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
}

.panel p {
    color: var(--ink-soft);
    font-size: 1.05rem;
    max-width: 38rem;
}

.panel p + p {
    margin-top: 0.9rem;
}

.panel a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid rgba(158, 42, 43, 0.35);
    transition: color 0.2s ease, border-color 0.2s ease;
}

.panel a:hover {
    color: var(--accent-soft);
    border-bottom-color: var(--accent-soft);
}

.about .contact {
    margin-top: 1.1rem;
    font-size: 1rem;
    color: var(--ink-faint);
}

.panel ul {
    color: var(--ink-soft);
    font-size: 1.05rem;
    padding-left: 1.2rem;
}

.panel li {
    margin-bottom: 0.65rem;
}

.panel li:last-child {
    margin-bottom: 0;
}

/* Publications */
.publications summary {
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.publications summary::-webkit-details-marker {
    display: none;
}

.publications-title {
    display: block;
    font-family: var(--font-display);
    font-size: 1.55rem;
    font-weight: 500;
    color: var(--ink);
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
}

.publication-preview {
    display: block;
    text-align: left;
}

.publication-preview ol,
.publications > ol {
    color: var(--ink-soft);
    font-size: 0.98rem;
    line-height: 1.55;
    margin: 0;
    padding-left: 1.35rem;
}

.publication-preview li {
    margin-bottom: 0;
}

.publications > ol {
    margin-top: 0.25rem;
}

.publications > ol li {
    margin-bottom: 1rem;
}

.publications > ol li:last-child {
    margin-bottom: 0;
}

.publications em {
    font-style: italic;
}

.more-indicator {
    display: inline-block;
    margin-top: 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.02em;
}

.more-indicator::after {
    content: " \2193";
}

.publications[open] .publication-preview,
.publications[open] .more-indicator {
    display: none;
}

.publications summary:hover .publications-title,
.publications summary:hover .more-indicator {
    color: var(--accent-soft);
}

.less-toggle {
    display: block;
    margin: 1.25rem 0 0;
    padding: 0;
    border: none;
    background: none;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent);
    cursor: pointer;
    letter-spacing: 0.02em;
}

.less-toggle:hover {
    color: var(--accent-soft);
}

/* Projects - accent aligned with system */
.project-card {
    background: var(--ink);
    color: var(--paper);
    padding: 1.75rem 1.5rem;
    border-radius: var(--radius);
    text-align: left;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--accent);
}

.project-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
    background: #243240;
}

.project-card h3 {
    font-family: var(--font-display);
    color: var(--paper);
    font-size: 1.35rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.project-card p {
    color: rgba(247, 245, 242, 0.78);
    margin-bottom: 1.15rem;
    font-size: 1rem;
}

.panel .project-link {
    display: inline-block;
    color: rgba(247, 245, 242, 0.92);
    padding: 0;
    text-decoration: none;
    border-bottom: 1px solid rgba(247, 245, 242, 0.45);
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.panel .project-link:hover {
    color: #f0c4c0;
    border-bottom-color: #f0c4c0;
}

.other-projects {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.project-card-secondary {
    padding: 0.15rem 0;
    text-align: left;
    border: none;
    background: transparent;
}

.project-card-secondary h3 {
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.project-card-secondary p {
    color: var(--ink-faint);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.panel .project-link-secondary {
    color: var(--accent);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid rgba(158, 42, 43, 0.35);
}

.panel .project-link-secondary:hover {
    color: var(--accent-soft);
    border-bottom-color: var(--accent-soft);
}

/* Social - no card */
.social-links {
    text-align: center;
    margin-top: 2rem;
    padding: 0.5rem 0;
    animation: rise 0.8s ease-out 0.22s both;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 0.85rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(247, 245, 242, 0.1);
    border: 1px solid var(--paper-edge);
    text-decoration: none;
    transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}

.social-links a:hover {
    transform: translateY(-3px);
    background: rgba(247, 245, 242, 0.2);
    border-color: rgba(247, 245, 242, 0.35);
}

.social-links img {
    width: 22px;
    height: 22px;
    max-width: none;
    object-fit: contain;
    /* Keep logos readable on dark atmosphere */
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

.social-links a[title="LinkedIn"] img {
    /* LinkedIn blue bug - keep brand color */
    filter: none;
    width: 20px;
    height: 20px;
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .header,
    .panel,
    .social-links {
        animation: none;
    }

    .project-card,
    .social-links a {
        transition: none;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 2rem 1rem 3rem;
    }

    .panel {
        padding: 1.75rem 1.35rem 2rem;
        border-radius: 10px;
    }

    .header {
        padding-bottom: 2rem;
    }

    .header .profile-photo {
        width: 120px;
        height: 120px;
    }

    .header .subtitle {
        font-size: 1rem;
    }

    .other-projects {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .social-links a {
        margin: 0 0.55rem;
    }
}
