/* Root Variables - Dark Mode */
:root {
    --bg-primary: #1e1e2e;
    --bg-secondary: #2d2d44;
    --bg-terminal: #1a1a1a;
    --bg-terminal-body: #0a0a0a;
    --text-primary: #00ff00;
    --text-secondary: #abb2bf;
    --border-color: #3a3a3a;
    --header-bg: #2d2d2d;
    
    /* Terminal colors - dark mode */
    --terminal-green: #00ff00;
    --terminal-blue: #61afef;
    --terminal-red: #ff6b6b;
    --terminal-yellow: #e5c07b;
    --terminal-cyan: #56b6c2;
    --terminal-magenta: #c678dd;
    --terminal-text: #abb2bf;
    
    /* Web view colors - dark mode */
    --web-text: #e6edf3;
    --web-text-secondary: #9198a1;
    --web-link: #58a6ff;
    --web-link-hover: #79c0ff;
    --web-heading: #ffffff;
}

/* Light Mode Variables - VSCode Light Theme inspired */
body.light-mode {
    --bg-primary: #f3f3f3;
    --bg-secondary: #e8e8e8;
    --bg-terminal: #ffffff;
    --bg-terminal-body: #ffffff;
    --text-primary: #000000;
    --text-secondary: #6a737d;
    --border-color: #e1e4e8;
    --header-bg: #f6f8fa;
    
    /* Terminal-specific light mode colors (VSCode-like) */
    --terminal-green: #008000;
    --terminal-blue: #0000ff;
    --terminal-red: #cd3131;
    --terminal-yellow: #795e26;
    --terminal-cyan: #007acc;
    --terminal-magenta: #af00db;
    --terminal-text: #333333;
    
    /* Web view colors - separate from terminal */
    --web-text: #24292e;
    --web-text-secondary: #586069;
    --web-link: #0366d6;
    --web-link-hover: #005cc5;
    --web-heading: #1a1a1a;
}

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

body {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    color: var(--text-primary);
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: hidden;
    transition: background 0.3s ease, color 0.3s ease;
}

/* View Controls - iOS Style */
.view-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.control-btn {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
    padding: 6px 14px;
    border-radius: 20px;
    border: none;
    background: rgba(120, 120, 128, 0.16);
    backdrop-filter: blur(20px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--terminal-cyan);
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

body.light-mode .control-btn {
    background: rgba(120, 120, 128, 0.12);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.control-btn:hover {
    background: rgba(120, 120, 128, 0.24);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

body.light-mode .control-btn:hover {
    background: rgba(120, 120, 128, 0.2);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.control-btn:active {
    transform: translateY(0);
    background: rgba(120, 120, 128, 0.3);
}

.control-btn .icon {
    font-size: 13px;
    display: flex;
    align-items: center;
}

/* Terminal Container */
.terminal-container {
    width: 100%;
    max-width: 1200px;
    height: 90vh;
    background: var(--bg-terminal);
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.terminal-container.hidden {
    display: none;
}

/* Terminal Header */
.terminal-header {
    background: var(--header-bg);
    padding: 10px 15px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.terminal-buttons {
    display: flex;
    gap: 8px;
    margin-right: 15px;
}

.btn {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.btn.close {
    background: #ff5f56;
}

.btn.minimize {
    background: #ffbd2e;
}

.btn.maximize {
    background: #27c93f;
}

.terminal-title {
    color: #a0a0a0;
    font-size: 13px;
    flex: 1;
    text-align: center;
}

.terminal-controls {
    margin-left: auto;
}

/* Terminal Body */
.terminal-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: var(--bg-terminal-body);
    font-size: 14px;
    line-height: 1.6;
}

#terminal-output {
    margin-bottom: 10px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.output-line {
    margin-bottom: 4px;
}

.output-line.command {
    color: var(--terminal-green);
}

.output-line.error {
    color: var(--terminal-red);
}

.output-line.info {
    color: var(--terminal-blue);
}

.output-line.success {
    color: #98c379;
}

body.light-mode .output-line.success {
    color: var(--terminal-green);
}

.output-line.warning {
    color: var(--terminal-yellow);
}

.directory {
    color: var(--terminal-blue);
    font-weight: bold;
}

.file {
    color: var(--terminal-text);
}

.executable {
    color: #98c379;
}

body.light-mode .executable {
    color: var(--terminal-cyan);
}

/* Input Line */
.input-line {
    display: flex;
    align-items: center;
}

.prompt {
    color: #98c379;
    margin-right: 8px;
    flex-shrink: 0;
}

body.light-mode .prompt {
    color: var(--terminal-cyan);
}

#terminal-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--terminal-green);
    font-family: inherit;
    font-size: inherit;
    caret-color: var(--terminal-green);
}

body.light-mode #terminal-input {
    color: var(--terminal-text);
    caret-color: var(--terminal-text);
}

/* Vim Viewer */
.vim-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #1e1e1e;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    color: #d4d4d4;
}

body.light-mode .vim-viewer {
    background: #ffffff;
    color: #333333;
}

.vim-viewer.hidden {
    display: none;
}

.vim-header {
    background: #2d2d2d;
    padding: 8px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #3a3a3a;
}

body.light-mode .vim-header {
    background: #f6f8fa;
    border-bottom: 1px solid #e1e4e8;
}

.vim-filename {
    color: #61afef;
    font-weight: bold;
}

body.light-mode .vim-filename {
    color: #007acc;
}

.vim-help {
    color: #888;
    font-size: 12px;
}

body.light-mode .vim-help {
    color: #6a737d;
}

.vim-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    background: #1e1e1e;
    white-space: pre-wrap;
    word-wrap: break-word;
    word-break: break-word;
}

body.light-mode .vim-content {
    background: #ffffff;
    color: #333333;
}

.vim-content pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    margin: 0;
    font-family: inherit;
}

.vim-footer {
    background: #2d2d2d;
    padding: 5px 15px;
    font-size: 12px;
    color: #888;
    border-top: 1px solid #3a3a3a;
}

body.light-mode .vim-footer {
    background: #f6f8fa;
    color: #6a737d;
    border-top: 1px solid #e1e4e8;
}

/* Content Styling in Vim Viewer */
.vim-content h1 {
    color: #61afef;
    font-size: 24px;
    margin-bottom: 15px;
    font-weight: bold;
}

.vim-content h2 {
    color: #c678dd;
    font-size: 20px;
    margin-top: 20px;
    margin-bottom: 12px;
    font-weight: bold;
}

.vim-content h3 {
    color: #e5c07b;
    font-size: 16px;
    margin-top: 15px;
    margin-bottom: 8px;
    font-weight: bold;
}

.vim-content p {
    color: #abb2bf;
    margin-bottom: 10px;
    line-height: 1.6;
}

.vim-content a {
    color: #61afef;
    text-decoration: none;
}

.vim-content a:hover {
    text-decoration: underline;
}

.vim-content .meta {
    color: #5c6370;
    font-style: italic;
    margin-bottom: 5px;
}

.vim-content .divider {
    border-top: 1px solid #3a3a3a;
    margin: 20px 0;
}

.vim-content strong {
    color: #e06c75;
    font-weight: bold;
}

/* Link styling */
a {
    color: #61afef;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Scrollbar styling */
.terminal-body::-webkit-scrollbar,
.vim-content::-webkit-scrollbar,
.plain-view::-webkit-scrollbar {
    width: 8px;
}

.terminal-body::-webkit-scrollbar-track,
.vim-content::-webkit-scrollbar-track,
.plain-view::-webkit-scrollbar-track {
    background: #1a1a1a;
}

body.light-mode .terminal-body::-webkit-scrollbar-track,
body.light-mode .vim-content::-webkit-scrollbar-track,
body.light-mode .plain-view::-webkit-scrollbar-track {
    background: #f0f0f0;
}

.terminal-body::-webkit-scrollbar-thumb,
.vim-content::-webkit-scrollbar-thumb,
.plain-view::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

body.light-mode .terminal-body::-webkit-scrollbar-thumb,
body.light-mode .vim-content::-webkit-scrollbar-thumb,
body.light-mode .plain-view::-webkit-scrollbar-thumb {
    background: #c0c0c0;
}

.terminal-body::-webkit-scrollbar-thumb:hover,
.vim-content::-webkit-scrollbar-thumb:hover,
.plain-view::-webkit-scrollbar-thumb:hover {
    background: #555;
}

body.light-mode .terminal-body::-webkit-scrollbar-thumb:hover,
body.light-mode .vim-content::-webkit-scrollbar-thumb:hover,
body.light-mode .plain-view::-webkit-scrollbar-thumb:hover {
    background: #a0a0a0;
}

/* Animations */
@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.cursor {
    animation: blink 1s infinite;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 0;
    }

    .terminal-container {
        max-width: 100%;
        height: 100vh;
        border-radius: 0;
    }

    .terminal-body {
        font-size: 12px;
        padding: 15px;
    }

    .vim-content {
        padding: 15px;
        font-size: 13px;
    }

    .vim-help {
        display: none;
    }
    
    .terminal-title {
        font-size: 11px;
    }
    
    .terminal-controls .control-btn {
        padding: 4px 10px;
        font-size: 10px;
    }
    
    .terminal-controls .control-btn .icon {
        font-size: 11px;
    }
}

/* ============================================
   PLAIN VIEW — hybrid (A's serif vibe + B's mono sidebar)
   Namespaced with --pv-* vars; does not affect terminal view.
   ============================================ */

.plain-view {
    /* dark mode defaults */
    --pv-bg: #151a1e;
    --pv-rail-bg: #151a1e;
    --pv-ink: #e8e6e1;
    --pv-muted: #9a958c;
    --pv-soft: #6f6a62;
    --pv-rule: #2a2f35;
    --pv-accent: #d9a89c;
    --pv-mono: 'JetBrains Mono', 'Monaco', 'Menlo', 'Consolas', monospace;
    --pv-serif: 'Charter', 'Iowan Old Style', 'Source Serif 4', 'Palatino', Georgia, serif;
    --pv-sans: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
    --pv-rail-w: 200px;
    --pv-rail-w-open: 290px;

    display: none;
    background: var(--pv-bg);
    color: var(--pv-ink);
    font-family: var(--pv-serif);
    font-size: 17px;
    line-height: 1.6;
    min-height: 100vh;
    width: 100%;
    overflow-y: auto;
    padding-left: 0;
}

body.light-mode .plain-view {
    --pv-bg: #ffffff;
    --pv-rail-bg: #f6f5f2;
    --pv-ink: #1a1714;
    --pv-muted: #6e655a;
    --pv-soft: #9a8f7e;
    --pv-rule: #e2dfd8;
    --pv-accent: #8a2a1f;
}

.plain-view.active {
    display: block;
    padding-left: var(--pv-rail-w-open);
}

/* Override body's flex-centered terminal layout when plain view is active */
body.pv-active {
    display: block;
    align-items: initial;
    justify-content: initial;
    padding: 0;
    overflow: auto;
    height: auto;
    background: var(--pv-bg, #fbfaf7);
}

/* --- SIDEBAR --- */
.pv-aside {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--pv-rail-w);
    height: 100vh;
    border-right: 1px solid var(--pv-rule);
    background: var(--pv-rail-bg);
    padding: 44px 22px;
    font-family: var(--pv-mono);
    color: var(--pv-soft);
    transition: width 0.22s ease;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 10;
}

.pv-aside:hover {
    width: var(--pv-rail-w-open);
    box-shadow: 6px 0 24px rgba(0, 0, 0, 0.06);
}

.pv-sigil {
    color: var(--pv-ink);
    font-size: 14.5px;
    margin-bottom: 32px;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.pv-sigil::before {
    content: '$';
    color: var(--pv-soft);
    margin-right: 0.55em;
}

.pv-sigil .pv-host {
    color: var(--pv-soft);
    opacity: 0;
    transition: opacity 0.15s ease;
}

.pv-sigil .pv-host::before {
    content: '@';
    margin: 0 0.4em;
}

.pv-aside:hover .pv-sigil .pv-host {
    opacity: 1;
    transition-delay: 0.08s;
}

.pv-block {
    margin-bottom: 26px;
}

.pv-block-label {
    color: var(--pv-soft);
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    margin-bottom: 9px;
    white-space: nowrap;
}

.pv-block a {
    color: var(--pv-ink);
    text-decoration: none;
    display: block;
    padding: 4px 0;
    font-size: 14.5px;
    font-family: var(--pv-mono);
    letter-spacing: 0.005em;
    transition: color 0.15s;
    white-space: nowrap;
}

.pv-block a:hover {
    color: var(--pv-accent);
}

.pv-block a.current {
    color: var(--pv-accent);
}

.pv-block a.current::before {
    content: '→ ';
    color: var(--pv-accent);
}

/* Extra blocks hidden until hover */
.pv-block.extra {
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    pointer-events: none;
}

.pv-aside:hover .pv-block.extra {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
    transition-delay: 0.06s;
}

/* Override iOS-pill control-btn styling when in plain-view sidebar */
.pv-aside .control-btn.pv-ctl {
    padding: 3px 0;
    background: none;
    backdrop-filter: none;
    border: none;
    box-shadow: none;
    color: var(--pv-ink);
    font-family: var(--pv-mono);
    font-size: 14px;
    letter-spacing: 0.005em;
    display: block;
    width: 100%;
    text-align: left;
    cursor: pointer;
    gap: 6px;
}

.pv-aside .control-btn.pv-ctl:hover {
    color: var(--pv-accent);
    background: none;
    transform: none;
    box-shadow: none;
}

.pv-aside .control-btn.pv-ctl .icon {
    font-size: 11px;
    margin-right: 4px;
}

/* --- MAIN --- */
.pv-main {
    max-width: 720px;
    margin: 0 auto;
    padding: 64px 48px 120px;
}

.pv-masthead {
    margin-bottom: 44px;
}

.pv-masthead h1 {
    font-size: 28px;
    font-weight: 600;
    letter-spacing: 0.005em;
    margin-bottom: 8px;
    color: var(--pv-ink);
    font-family: var(--pv-serif);
}

.pv-masthead .pv-sub {
    font-family: var(--pv-mono);
    font-size: 12.5px;
    color: var(--pv-muted);
    letter-spacing: 0.01em;
}

.pv-main section {
    margin-bottom: 56px;
}

.pv-main h2 {
    font-family: var(--pv-sans);
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--pv-muted);
    font-weight: 600;
    margin-bottom: 22px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--pv-rule);
}

.pv-main p {
    margin-bottom: 14px;
    color: var(--pv-ink);
}

.pv-lede {
    font-size: 18.5px;
    line-height: 1.65;
}

.pv-lede em,
.pv-lede strong {
    color: var(--pv-accent);
    font-style: normal;
    font-weight: 600;
}

.pv-about-list {
    margin: -2px 0 18px 24px;
    padding: 0;
    color: var(--pv-ink);
    font-family: var(--pv-serif);
    font-size: 17px;
    line-height: 1.65;
}

.pv-about-list li {
    padding-left: 8px;
    margin-bottom: 6px;
}

.pv-main a {
    color: var(--pv-ink);
    text-decoration: none;
    border-bottom: 1px solid var(--pv-muted);
    transition: color 0.15s, border-color 0.15s;
}

.pv-main a:hover {
    color: var(--pv-accent);
    border-bottom-color: var(--pv-accent);
    text-decoration: none;
}

/* --- Publications grouped by theme --- */
.pv-theme {
    margin-bottom: 32px;
}

.pv-theme-label {
    font-family: var(--pv-sans);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.13em;
    color: var(--pv-accent);
    margin-bottom: 6px;
    font-weight: 600;
}

.pv-theme-blurb {
    font-size: 15px;
    color: var(--pv-muted);
    font-style: italic;
    margin-bottom: 18px;
}

.pv-pub {
    font-size: 15px;
    line-height: 1.5;
    padding-left: 0;
    text-indent: 0;
    margin-bottom: 26px;
}

.pv-pub .pv-pub-title {
    font-weight: 600;
}

.pv-pub .pv-pub-authors,
.pv-pub .pv-pub-venue {
    color: var(--pv-muted);
    font-size: 14px;
}

.pv-pub .pv-pub-venue {
    font-style: italic;
}

.pv-pub .pv-pub-links {
    font-size: 12.5px;
    font-family: var(--pv-mono);
}

.pv-pub .pv-pub-links a {
    color: var(--pv-muted);
    margin-right: 12px;
    text-decoration: none;
    border-bottom: 1px dotted var(--pv-muted);
}

.pv-pub .pv-pub-links a:hover {
    color: var(--pv-accent);
    border-color: var(--pv-accent);
}

.pv-theme.earlier {
    margin-top: 36px;
    padding-top: 20px;
    border-top: 1px solid var(--pv-rule);
}

.pv-theme.earlier .pv-theme-label {
    color: var(--pv-muted);
}

/* --- CV --- */
.pv-exp-row {
    display: grid;
    grid-template-columns: 175px 1fr;
    gap: 40px;
    padding: 11px 0;
    border-bottom: 1px dotted var(--pv-rule);
    font-size: 15px;
}

.pv-exp-row .pv-when {
    color: var(--pv-muted);
    font-size: 12.5px;
    font-family: var(--pv-mono);
    padding-top: 2px;
    white-space: nowrap;
}

.pv-exp-row .pv-role {
    font-weight: 600;
}

.pv-exp-row .pv-org {
    color: var(--pv-muted);
    font-size: 14px;
}

/* --- CV toggle --- */
.pv-cv-toggle {
    display: inline-block;
    margin-top: 14px;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--pv-mono);
    font-size: 12.5px;
    color: var(--pv-muted);
    letter-spacing: 0.005em;
    transition: color 0.15s;
}

.pv-cv-toggle:hover {
    color: var(--pv-accent);
}

.pv-cv-full {
    margin-top: 6px;
}

/* --- Writing (blog) --- */
.pv-post {
    padding: 14px 0;
    border-bottom: 1px dotted var(--pv-rule);
}

.pv-post:last-child {
    border-bottom: none;
}

.pv-post-title {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
}

.pv-post-date {
    font-family: var(--pv-mono);
    font-size: 12px;
    color: var(--pv-muted);
    margin-bottom: 8px;
}

.pv-post-body {
    font-size: 15px;
    color: var(--pv-ink);
    line-height: 1.6;
}

/* --- Footer --- */
.pv-footer {
    margin-top: 60px;
    padding-top: 20px;
    border-top: 1px solid var(--pv-rule);
    font-family: var(--pv-mono);
    font-size: 12px;
    color: var(--pv-muted);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.pv-footer a {
    color: var(--pv-muted);
    text-decoration: none;
    margin-right: 14px;
    border-bottom: 1px dotted var(--pv-muted);
}

.pv-footer a:hover {
    color: var(--pv-ink);
    border-bottom-color: var(--pv-ink);
}

.pv-footer-links a {
    display: inline-block;
}

/* --- Mobile: sidebar becomes top strip, everything expanded --- */
@media (max-width: 820px) {
    .plain-view.active {
        padding-left: 0;
    }

    .pv-aside {
        position: static;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--pv-rule);
        padding: 24px;
        overflow: visible;
    }

    .pv-aside:hover {
        width: 100%;
        box-shadow: none;
    }

    .pv-sigil .pv-host {
        opacity: 1;
    }

    .pv-block.extra {
        opacity: 1;
        transform: none;
        pointer-events: auto;
    }

    .pv-block {
        display: inline-block;
        margin-right: 22px;
        margin-bottom: 12px;
        vertical-align: top;
    }

    .pv-block-label {
        display: block;
        margin-bottom: 4px;
    }

    .pv-block a {
        padding: 2px 0;
    }

    .pv-main {
        padding: 36px 24px 80px;
    }
}

/* ============================================
   Additions for williamium3000.github.io
   (masthead photo, news list, CV groups)
   ============================================ */

.pv-masthead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.pv-masthead-text {
    min-width: 0;
}

.pv-masthead h1 .pv-zh {
    font-weight: 400;
    font-size: 0.72em;
    color: var(--pv-muted);
    letter-spacing: 0.12em;
    margin-left: 6px;
    white-space: nowrap;
}

.pv-masthead .pv-contact {
    margin-top: 8px;
    font-family: var(--pv-mono);
    font-size: 12px;
    line-height: 1.8;
}

.pv-masthead .pv-contact a {
    color: var(--pv-muted);
    border-bottom: 1px dotted var(--pv-muted);
}

.pv-masthead .pv-contact a:hover {
    color: var(--pv-accent);
    border-bottom-color: var(--pv-accent);
}

.pv-photo {
    flex: none;
    width: 168px;
    height: 168px;
    object-fit: cover;
    object-position: center 18%;
    border-radius: 6px;
    border: 1px solid var(--pv-rule);
    box-shadow: 0 1px 0 var(--pv-rule);
}

/* News rows reuse the CV grid so the mono dates line up with the CV. */
.pv-news-row {
    display: grid;
    grid-template-columns: 175px 1fr;
    gap: 40px;
    padding: 8px 0;
    border-bottom: 1px dotted var(--pv-rule);
    font-size: 15px;
    line-height: 1.5;
}

.pv-news-row[hidden] {
    display: none;
}

.pv-news-row .pv-when {
    color: var(--pv-muted);
    font-size: 12.5px;
    font-family: var(--pv-mono);
    padding-top: 2px;
    white-space: nowrap;
}

.pv-cv-group-label {
    font-family: var(--pv-sans);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--pv-soft);
    margin: 22px 0 4px;
}

/* busuanzi reveals this once the count has loaded */
#busuanzi_container_site_pv {
    display: none;
    color: var(--pv-soft);
    white-space: nowrap;
}

@media (max-width: 820px) {
    .pv-masthead {
        flex-direction: column-reverse;
        align-items: flex-start;
        gap: 18px;
    }

    .pv-photo {
        width: 96px;
        height: 96px;
    }

    .pv-news-row,
    .pv-exp-row {
        grid-template-columns: 1fr;
        gap: 2px;
    }
}

/* --- masthead extras --- */
.pv-masthead .pv-sub-quiet {
    color: var(--pv-soft);
    margin-top: 3px;
}

.pv-masthead .pv-contact {
    color: var(--pv-soft);
}

/* --- beyond research --- */
.pv-life {
    margin-bottom: 30px;
}

.pv-life-title {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
}

.pv-life-text {
    font-size: 15px;
    color: var(--pv-muted);
}

.pv-life-photos {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 6px;
}

.pv-life-photo {
    margin: 0;
}

.pv-life-photo img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--pv-rule);
    display: block;
}

.pv-life-photo figcaption {
    font-family: var(--pv-mono);
    font-size: 11.5px;
    color: var(--pv-soft);
    margin-top: 6px;
}

/* --- chat / calendly --- */
.pv-calendly {
    position: relative;
    border: 1px solid var(--pv-rule);
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    margin: 6px 0 10px;
}

.pv-calendly[hidden] {
    display: none;
}

.pv-calendly-status {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--pv-mono);
    font-size: 12.5px;
    color: #8d857a;
    pointer-events: none;
}

.pv-calendly-fallback {
    font-family: var(--pv-mono);
    font-size: 12px;
    color: var(--pv-soft);
}

@media (max-width: 820px) {

}

/* --- justified running text --- */
#pv-about-body p,
#pv-about-body li,
.pv-life-text,
#pv-chat p {
    text-align: justify;
    hyphens: auto;
    -webkit-hyphens: auto;
}

/* --- extended bio (collapsed by default) --- */
.pv-bio-full {
    margin-top: 14px;
}

.pv-block a.pv-subnav {
    padding-left: 16px;
    color: var(--pv-muted);
    font-size: 13.5px;
}

.pv-block a.pv-subnav::before {
    content: "└ ";
    color: var(--pv-soft);
}

.pv-block a.pv-subnav:hover,
.pv-block a.pv-subnav.open {
    color: var(--pv-accent);
}

.pv-pubs-note {
    font-family: var(--pv-mono);
    font-size: 12px;
    color: var(--pv-soft);
    margin: -6px 0 18px;
}

/* Links always start their own line under the citation. */
.pv-pub .pv-pub-links {
    display: block;
    margin-top: 3px;
}

.pv-life-full {
    margin-top: 16px;
}

.pv-life-full[hidden] {
    display: none;
}

/* A section heading that doubles as an expand/collapse control. */
.pv-main h2.pv-h2-collapsible {
    padding-bottom: 0;
    border-bottom: none;
}

.pv-main h2.pv-h2-collapsible button {
    display: block;
    width: 100%;
    padding: 0 0 10px;
    border: none;
    border-bottom: 1px solid var(--pv-rule);
    background: none;
    cursor: pointer;
    text-align: left;
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    color: inherit;
    transition: color 0.15s;
}

.pv-main h2.pv-h2-collapsible button:hover {
    color: var(--pv-accent);
}

.pv-main h2.pv-h2-collapsible .pv-caret {
    margin-left: 6px;
    font-family: var(--pv-mono);
}

/* My own name in an author list. */
.pv-pub .pv-self {
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Award note on a venue, e.g. Highlight (top 2.5%). */
.pv-pub .pv-award {
    font-weight: 600;
    font-style: normal;
}

/* Secondary line on a CV row, e.g. the instructor a course was taught with. */
.pv-exp-row .pv-note {
    color: var(--pv-soft);
    font-size: 14px;
}

/* Visitor globe, carried over from the previous site. */
/* The globe script sizes itself to this container's width. */
.pv-globe {
    width: 320px;
    margin: 48px auto 8px;
}

.pv-globe[hidden] {
    display: none;
}

.pv-globe canvas,
.pv-globe img {
    max-width: 100%;
}

.pv-chat-full {
    margin-top: 16px;
}

.pv-chat-full[hidden] {
    display: none;
}

.pv-pubs-rest[hidden] {
    display: none;
}
