body {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* Gen Z mode: transforms all text to lowercase */
body.genz-mode {
    text-transform: lowercase;
    font-family: 'Quicksand', 'Latin Modern', Georgia, serif;
}

/* Sparkle after section headings in Gen Z mode */
body.genz-mode h2::after {
    content: " \2728";
}

header {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
}

.left-column {
    flex: 1;
    max-width: 250px;
}

.right-column {
    flex: 2;
}

.right-column h2 {
    margin-top: 0;
}

.headshot {
    width: 100%;
    max-width: 240px;
    border-radius: 8px;
    margin-bottom: 10px;
    margin-top: 6px;
    user-drag: none;
    -webkit-user-drag: none;
    user-select: none;
    -moz-user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
}

.social-icons {
    display: flex;
    justify-content: left;
    gap: 10px;
    margin-bottom: 10px;
}

.social-icons a {
    text-decoration: none;
}

.social-icons i {
    font-size: 20px;
    color: #333;
}

i.fas:hover:not(#dark-mode-toggle i),
i.fab:hover:not(#dark-mode-toggle i) {
    color: #a80000;
    transition: color 0.3s;
}

body.latex-dark i.fas,
body.latex-dark i.fab {
    color: #bbb;
}

body.latex-dark i.fas:hover:not(#dark-mode-toggle i),
body.latex-dark i.fab:hover:not(#dark-mode-toggle i) {
    color: #95daf3;
}

.contact-info {
    margin-top: 10px;
}

.contact-info p {
    margin: 5px 0;
}

.news-date {
    font-weight: bold;
    margin-right: 10px;
}

.publication-list {
    list-style: disc;
    padding-left: 20px;
    margin: 0;
}

/* Right-click menu on the headshot */
.headshot-menu {
    position: fixed;
    left: 0;
    top: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14);
    padding: 4px;
    z-index: 2000;
    min-width: 210px;
    font-family: 'Latin Modern', Georgia, serif;
    /* Always laid out so we can measure, but invisible until .is-open. */
    visibility: hidden;
    opacity: 0;
    transform: scale(0.96);
    transform-origin: top left;
    transition: opacity 90ms ease-out, transform 90ms ease-out;
    pointer-events: none;
}
.headshot-menu.is-open {
    visibility: visible;
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}
.headshot-menu button {
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    padding: 8px 12px;
    font-size: 14px;
    font-family: inherit;
    color: #222;
    cursor: pointer;
    border-radius: 4px;
}
.headshot-menu button:hover {
    background: #f3f3f3;
}
body.latex-dark .headshot-menu {
    background: #1f1f1f;
    border-color: #444;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}
body.latex-dark .headshot-menu button {
    color: #eee;
}
body.latex-dark .headshot-menu button:hover {
    background: #2a2a2a;
}

.copy-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    background: #1a1a1a;
    color: #fff;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 13px;
    z-index: 2001;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    visibility: hidden;
    opacity: 0;
    transform: translateX(-50%) translateY(6px);
    transition: opacity 140ms ease, transform 140ms ease;
    pointer-events: none;
}
.copy-toast.is-open {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
body.latex-dark .copy-toast {
    background: #f1f1f1;
    color: #111;
}

/* Publication filter pills */
.pub-note {
    font-size: 13px;
    color: #666;
    margin: 0 0 8px 0;
}
body.latex-dark .pub-note {
    color: #aaa;
}
.pub-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 4px 0 14px 0;
}
.pub-filters button {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 999px;
    padding: 3px 12px;
    font-size: 13px;
    font-family: inherit;
    color: #555;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.pub-filters button:hover {
    background: #eee;
}
.pub-filters button.active {
    background: #1a1a1a;
    color: #fff;
    border-color: #1a1a1a;
}
body.latex-dark .pub-filters button {
    background: #2a2a2a;
    border-color: #444;
    color: #ccc;
}
body.latex-dark .pub-filters button:hover {
    background: #333;
}
body.latex-dark .pub-filters button.active {
    background: #f1f1f1;
    color: #111;
    border-color: #f1f1f1;
}

.publication-list li {
    margin-bottom: 15px;
}

.publication-entry {
    margin: 0;
    line-height: 1.4;
}

.publication-list a {
    text-decoration: none;
}

.publication-list a:hover {
    text-decoration: underline;
}

.publication-list strong {
    font-weight: bold;
}

.publication-list em {
    font-style: italic;
}

.name-and-toggle {
    display: flex;
    justify-content: space-between; 
    align-items: center;
}

.toggle-buttons {
    display: flex;
    gap: 8px;
    margin-left: 8px;
}

#dark-mode-toggle {
    background-color: #333;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
    margin: 0;
    line-height: 1;
    font-size: 20px;
    width: 36px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Gen Z toggle styling */
#genz-mode-toggle {
    background-color: #333;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
    margin: 0;
    line-height: 1;
    font-size: 16px;
    width: 36px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Style when Gen Z mode is active */
#genz-mode-toggle.active {
    background-color: #666; /* or any distinct color to show it's active */
    border: 1px solid #aaa; /* gives an outline even in light mode */
}

/* Outline around Gen Z button in dark mode */
body.latex-dark #genz-mode-toggle {
    border: 1px solid #aaa; /* same as dark-mode-toggle */
}

body.latex-dark #dark-mode-toggle {
    background-color: #3a3a3a;
    border: 1px solid #aaa;
}

body.latex-dark #dark-mode-toggle:hover {
    background-color: #555;
    color: #f1f1f1;
}

#dark-mode-toggle:hover {
    background-color: #555;
    color: #f1f1f1;
}

/* Hover for Gen Z mode toggle */
#genz-mode-toggle:hover {
    background-color: #555;
    color: #f1f1f1;
}

.right-column h2 {
    margin: 0;
    padding: 0;
    line-height: 1.2;
}

.talks-list {
    list-style: disc;
    padding-left: 20px;
    margin: 0;
}

.talks-list > li {
    margin-bottom: 15px;
}

.talk-title {
    margin: 0 0 3px 0;
    line-height: 1.3;
}

.talk-title a {
    text-decoration: none;
}

.talk-details {
    list-style: none;
    padding-left: 20px;
    margin: 0;
}

.talk-details li {
    margin-top: -6px;
}

.music-list {
    list-style: none;
    padding-left: 0;
    margin: 15px 0 0 0;
}

.music-list li {
    margin-bottom: 6px;
    line-height: 1.5;
}

.performance-date {
    font-weight: bold;
    min-width: 85px;
    display: inline-block;
}

.performance-group {
    font-style: italic;
}

.performance-repertoire {
    font-size: 0.95em;
    color: #666;
}

body.latex-dark .performance-repertoire {
    color: #999;
}

.performance-venue {
    color: #555;
}

body.latex-dark .performance-venue {
    color: #aaa;
}

.music-list a {
    text-decoration: none;
}

.music-list a:hover {
    text-decoration: underline;
}

footer {
    padding-top: 5px;
}

/* Site switcher (shared look with the personal site) */
.site-switcher {
    position: fixed;
    top: 12px;
    right: 16px;
    z-index: 1000;
    font-family: 'Latin Modern', Georgia, serif;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #ddd;
    border-radius: 999px;
    padding: 4px 12px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.site-switcher-link {
    color: #666;
    text-decoration: none;
    padding: 2px 4px;
    transition: color 0.2s;
}

.site-switcher-link:hover {
    color: #a80000;
}

.site-switcher-link.active {
    color: #111;
    font-weight: 600;
}

.site-switcher-divider {
    color: #bbb;
    margin: 0 2px;
}

body.latex-dark .site-switcher {
    background: rgba(30, 30, 30, 0.9);
    border-color: #444;
}

body.latex-dark .site-switcher-link {
    color: #aaa;
}

body.latex-dark .site-switcher-link.active {
    color: #f1f1f1;
}

body.latex-dark .site-switcher-link:hover {
    color: #95daf3;
}

body.latex-dark .site-switcher-divider {
    color: #555;
}

/* On narrow screens, drop the floating pill and let the switcher flow
   inline at the top of the page so it doesn't overlap the toggle buttons
   or the headshot/name header on mobile. */
@media (max-width: 720px) {
    .site-switcher {
        position: static;
        display: flex;
        align-items: center;
        background: transparent;
        border: none;
        box-shadow: none;
        padding: 0 0 14px 0;
        font-size: 13px;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }
    /* Toggles get moved into the switcher row by JS on mobile.
       Push them left; parent has align-items: center so heights align. */
    .site-switcher .toggle-buttons {
        margin-right: auto;
        margin-left: 0;
    }
    body.latex-dark .site-switcher {
        background: transparent;
        border: none;
    }

    /* Wrap social icons to two rows of 3 on mobile so they don't
       push the right column narrower. */
    .social-icons {
        flex-wrap: wrap;
        max-width: 110px;
        row-gap: 8px;
    }
}

/* ---------------------------------------------------------------------------
   Reading Log (/books)
--------------------------------------------------------------------------- */
.books-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
}
.books-login-form {
    display: flex;
    gap: 8px;
    margin: 12px 0;
    max-width: 360px;
}
.books-login-form input { flex: 1; padding: 6px 10px; }
.books-error { color: #a80000; }
.books-muted { color: #777; font-size: 0.9em; }
body.latex-dark .books-muted { color: #999; }
.books-danger { color: #a80000; }

/* Book list of content cards */
.book-grid {
    list-style: none;
    padding: 0;
    margin: 16px 0 0 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.book-card {
    display: flex;
    gap: 18px;
    cursor: pointer;
    padding: 16px;
    border: 1px solid #e2e2e2;
    border-radius: 8px;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.book-card:hover { border-color: #c8c8c8; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06); }
.book-card:focus-visible { outline: 2px solid #555; outline-offset: 2px; }
body.latex-dark .book-card { border-color: #3a3a3a; }
body.latex-dark .book-card:hover { border-color: #555; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3); }
.book-cover {
    width: 92px;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
    display: block;
    flex-shrink: 0;
}
.book-cover-blank {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 8px;
    font-size: 0.8em;
    background: #ececec;
    color: #444;
}
body.latex-dark .book-cover-blank { background: #2a2a2a; color: #ccc; }
.book-card-body { min-width: 0; }
.book-card-title { font-weight: 600; line-height: 1.25; font-size: 1.05em; }
.book-card-meta { font-size: 0.85em; color: #777; margin-top: 2px; }
body.latex-dark .book-card-meta { color: #999; }
.book-card-preview {
    font-size: 0.9em;
    line-height: 1.45;
    margin: 8px 0 0 0;
    color: #444;
}
body.latex-dark .book-card-preview { color: #c4c4c4; }
.book-card-preview .lbl {
    font-variant: small-caps;
    letter-spacing: 0.04em;
    color: #999;
    margin-right: 4px;
}
body.latex-dark .book-card-preview .lbl { color: #888; }

@media (max-width: 720px) {
    .book-cover { width: 68px; }
    .book-card { padding: 12px; gap: 12px; }
}

/* Detail view */
.books-back {
    background: none;
    border: none;
    color: #555;
    cursor: pointer;
    padding: 0;
    font-size: 0.9em;
    margin-bottom: 10px;
}
body.latex-dark .books-back { color: #aaa; }
.book-detail { margin-top: 4px; }
.book-detail-cover {
    float: left;
    width: 130px;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
    margin: 4px 22px 12px 0;
}
#detail-title { margin: 0 0 6px 0; line-height: 1.2; }
#detail-meta { margin: 0 0 16px 0; }
#detail-sections h3 { margin: 18px 0 6px 0; }
#detail-sections > *:first-child { margin-top: 0; }
.book-detail-actions { clear: both; padding-top: 12px; }

/* Add / edit form */
.books-form { display: flex; flex-direction: column; gap: 14px; max-width: 640px; }
.books-form label { display: flex; flex-direction: column; gap: 4px; font-size: 0.9em; color: #555; }
body.latex-dark .books-form label { color: #bbb; }
.books-form input,
.books-form textarea {
    font-family: inherit;
    font-size: 1rem;
    padding: 6px 10px;
    width: 100%;
    box-sizing: border-box;
}
.books-form textarea { resize: vertical; }
.books-lookup-row { display: flex; gap: 8px; }
.books-lookup-row input { flex: 1; }
.books-form-actions { display: flex; gap: 10px; }

@media (max-width: 620px) {
    .book-detail-cover { width: 100px; margin-right: 16px; }
}

/* Reading-log fixed dark-mode toggle */
.books-topbar {
    position: fixed;
    top: 12px;
    right: 16px;
    z-index: 1000;
}

/* Reading-log buttons — pill style matching the site aesthetic */
.bk-btn {
    font-family: inherit;
    font-size: 0.88em;
    padding: 5px 15px;
    border-radius: 999px;
    border: 1px solid #ccc;
    background: #f5f5f5;
    color: #333;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.bk-btn:hover { background: #eaeaea; border-color: #bbb; }
.bk-btn-primary { background: #1a1a1a; color: #fff; border-color: #1a1a1a; }
.bk-btn-primary:hover { background: #000; border-color: #000; }
.bk-btn-quiet { background: transparent; border-color: transparent; color: #777; }
.bk-btn-quiet:hover { background: transparent; color: #333; text-decoration: underline; }
.bk-btn-danger { background: transparent; border-color: transparent; color: #a80000; }
.bk-btn-danger:hover { background: transparent; border-color: transparent; text-decoration: underline; }

body.latex-dark .bk-btn { background: #2a2a2a; border-color: #444; color: #ddd; }
body.latex-dark .bk-btn:hover { background: #333; border-color: #666; }
body.latex-dark .bk-btn-primary { background: #f1f1f1; color: #111; border-color: #f1f1f1; }
body.latex-dark .bk-btn-primary:hover { background: #fff; border-color: #fff; }
body.latex-dark .bk-btn-quiet { background: transparent; border-color: transparent; color: #999; }
body.latex-dark .bk-btn-quiet:hover { color: #eee; }
body.latex-dark .bk-btn-danger { color: #ff6b6b; background: transparent; border-color: transparent; }

/* Clamp card previews to a fixed number of lines so heights stay uniform */
.book-card-preview {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
}

/* Reading-log form: two-column metadata grid + auto-growing textareas */
.books-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.books-form-grid .bk-span2 { grid-column: 1 / -1; }
.bk-grow {
    min-height: 44px;
    overflow: hidden;
    resize: none;
}
@media (max-width: 620px) {
    .books-form-grid { grid-template-columns: 1fr; }
}

/* Star rating: picker (editor) + display (cards, detail) */
.star-input {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 1.5em;
    cursor: pointer;
    user-select: none;
    line-height: 1;
}
.star-input .star { color: #d3d3d3; transition: color 0.1s; }
.star-input .star.on { color: #e6b800; }
.star-input .star.hover { color: #f2ca42; }
body.latex-dark .star-input .star { color: #4a4a4a; }
body.latex-dark .star-input .star.on { color: #e6b800; }
.star-hint { font-size: 0.5em; margin-left: 10px; }
.book-card-stars { color: #e6b800; font-size: 0.95em; letter-spacing: 1.5px; margin-top: 3px; }
.stars-inline { color: #e6b800; letter-spacing: 1.5px; }

/* Reading-log top action bar (Back on the left, actions on the right) */
.books-actionbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.books-actionbar .books-back { margin-bottom: 0; }
.books-actionbar-right { display: flex; gap: 8px; }

/* Footer text links (real anchor text for SEO; subtle so it stays footer-y) */
.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin-top: 8px;
    font-size: 0.85em;
}
.footer-links a {
    color: #777;
    text-decoration: none;
}
.footer-links a:hover { color: #a80000; text-decoration: underline; }
body.latex-dark .footer-links a { color: #999; }
body.latex-dark .footer-links a:hover { color: #95daf3; }
