:root {
    --bg: #fffffc;
    --text: #1a1a1a;
    --accent: #01261b;
    --link: #090c8d;
    --secondary: #666;
    --header-bg: #f8f9fa;
    --tag-light: #fcfffc;
    --tag-dark: #3a393f;
}

.via {
    font-size: 90%;
    font-style: italic;
}

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

a {
    color: var(--link);
    text-decoration: underline;
    text-underline-offset: 0.15em;
    text-decoration-thickness: 0.05em;
    text-decoration-style: dotted;
}

nav a,
header a {
    text-decoration: none;
}

.shortlink {
   overflow: hidden; /* Hide overflow */
   white-space: nowrap; /* Prevent wrapping */
   text-overflow: ellipsis; /* Add ellipsis */ 
   max-width: 350px;
   margin:0;
}

body {
    font-family:
        system-ui,
        -apple-system,
        sans-serif;
    line-height: 1.45;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
    padding: 0.5rem;
    background: var(--bg);
    color: var(--text);
}

pre code {
  margin-top: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  padding-top: 0.5rem;
  border: 1px solid #eeeeff;
}

pre {
  white-space: pre-wrap;
}

body p {
    font-size: 0.9em;
    margin-top: 0.2em;
    margin-bottom: 0.5em;
}

ul {
    font-size: 0.9em;
    padding-left: 1rem;
    margin-left: 0;
    list-style-position: outside;
    margin-bottom: 0.5em;
}

ol {
    font-size: 0.9em;
    padding-left: 1rem;
    margin-left: 0;
    list-style-position: outside;
    margin-bottom: 0.5em;
}

.title-date {
    font-size: 0.8em;
    color: #aa9999;
    font-style: italic;
    font-weight: 300;
    white-space: nowrap;
}

.morewords {
  font-style: italic;
  font-size: 0.9em;
  font-weight: 500;
  white-space: nowrap;
}

.note-meta {
  display: none;
}

.word-count-link {
  text-decoration: none;
  color: inherit;
}

.word-count-link:hover {
  text-decoration: underline;
}

.paper {
    margin-bottom: 0.4rem;
}

.paper-info > p {
    margin-top: 0.5em;
    margin-bottom: 0em;
    margin-top: 0em;
}

.paper-info > .paper-title { font-weight: 500; }
.paper-info { font-size: 95%; font-weight: 300; }

.heading-anchor {
    margin-left: 0.5em;
    opacity: 0;
    transition: opacity 0.2s;
}

.note h1:hover .heading-anchor,
.note h2:hover .heading-anchor,
.note h3:hover .heading-anchor,
.note h4:hover .heading-anchor,
.note h5:hover .heading-anchor,
.note h6:hover .heading-anchor {
    opacity: 1;
}

.heading-anchor > a {
    color: #aaaaaa;
    font-size: 80%;
    text-decoration: none;
    font-style: italic;
}

.heading-anchor > a:hover {
    color: var(--link);
}

[role="doc-endnotes"] {
    font-size: 0.87rem;
    line-height: 1em;
    display: inline;
    font-style: italic;
}

.contact {
    white-space: nowrap;
}

.year-label {
    display: inline-block;
    color: #222222;
    padding: 0.1em 0.1em;
    border-radius: 2px;
    margin-right: 0em;
    margin-bottom: 0em;
    white-space: nowrap;
}
.year-label:hover {
    cursor: pointer;
}

.tags > .tag-label {
  display: inline;
  padding-right: 5px;
  gap: 0px;
  border-radius: 0px;
  color: #333399;
}

.tag-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #111177;
    font-weight: 400;
    padding: 8px 8px;
    border-radius: 4px;
    cursor: pointer;
    padding: 0.1em 0.1em;
    white-space: nowrap;
}
.tag-count-container {
    display: inline-flex;
    border-radius: 999px;
    overflow: hidden;
    height: 15px;
    font-size: 0.9em;
    line-height: 1;
    margin: 0;
    margin-right: 0.2em;
    margin-left: -0.35em;
}
nav .tag-label {
    display: inline-block;
    color: var(--link);
    font-weight: 500;
    font-size: 0.9em;
    padding: 0.1em 0.1em;
    border-radius: 0.5em;
    margin-right: 0em;
    margin-bottom: 0em;
    white-space: nowrap;
}
.tag-control {
    display: inline-block;
    color: #222222;
    padding: 0.1em 0.1em;
    border-radius: 2px;
    margin-right: 0em;
    margin-bottom: 0em;
    white-space: nowrap;
}
.tag-label:hover {
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
}

/* Tag search links (##tag syntax in markdown) */
.tag-search-link {
    color: #333399;
    text-decoration: underline;
    text-decoration-style: dashed;
    cursor: context-menu;
}

.tag-search-link:hover {
    text-decoration: underline;
    text-decoration-style: dotted;
}
.tag-click {
   color: var(--link);
   text-decoration: underline;
   text-underline-offset: 0.15em;
   text-decoration-thickness: 0.05em;
   text-decoration-style: dotted;
}

.tag-click:hover {
    cursor: pointer;
}
.tag-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    background: #555599;
    opacity: 90%;
    color: white;
    font-size: 0.80em;
    font-weight: 200;
}
.tag-count-bg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding-right: 4px;
    padding-left: 3px;
    background: #808080;
    opacity: 60%;
    color: #ffffff;
    font-size: 0.85em;
}

nav .tag-count-container {
    margin-left: 0.2em;
    margin-right: 0.2em;
}
nav .tag-count {
    font-weight: 200;
}
.tag-active > .tag-count {
    background: #336633;
}
.tag-relevant > .tag-count {
    background: #ff5599;
}
.tag-relevant > .tag-count-bg {
    background: #999999;
}
.tag-relevant {
    color: #333399;
    font-weight: 500;
}
.tag-active {
    color: #335533;
    background-color: #ddeddd;
    border-radius: 8px !important;
    padding: 0px;
    padding-left: 5px;
}
.year-active {
    color: #335533;
    background-color: #ddeddd;
    border-radius: 8px;
}
.tag-active .tag-count {
    background: #336633;
}

.author {
    font-style: italic;
}

li {
    margin-bottom: 0.5em;
}
.idea-available {
    white-space: nowrap;
    background-color: #ddffdd;
}

.idea-discussion {
    white-space: nowrap;
    background-color: #efee99;
}

.idea-ongoing {
    white-space: nowrap;
    background-color: #ffeebb;
}

.idea-completed {
    white-space: nowrap;
    background-color: #f0f0fe;
}

.idea-expired {
    white-space: nowrap;
    background-color: #cccccc;
}

[data-theme="dark"] .idea-available {
    color: var(--tag-light);
}

[data-theme="dark"] .idea-discussing {
    color: var(--tag-light);
}

[data-theme="dark"] .idea-ongoing {
    color: var(--tag-light);
}

header {
    margin-bottom: 0.5rem;
    width: 100%;
    max-width: 1000px;
}

/* New horizontal header layout */
.site-header {
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 1rem;
    padding: 0.75rem 0;
}

.header-content {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    gap: 0.75rem;
    align-items: center;
    justify-items: center;
}

.site-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
    grid-column: 1;
    grid-row: 1;
    justify-self: center;
    margin-right: 40px; /* offset for search button width */
}

.site-name a {
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s;
}

.site-name a:hover {
    color: var(--link);
}

.main-nav {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: center;
    border: none;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
    grid-column: 1;
    grid-row: 2;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: opacity 0.2s;
    white-space: nowrap;
}

.nav-link:hover {
    opacity: 0.7;
}

.nav-link svg {
    width: 16px;
    height: 16px;
    stroke: var(--secondary);
    opacity: 0.7;
    display: block;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    grid-column: 1;
    grid-row: 1;
    justify-self: end;
    align-self: start;
}

/* Desktop layout - single row */
@media (min-width: 769px) {
    .site-header {
        padding: 1rem 0;
    }

    .header-content {
        grid-template-columns: auto 1fr auto;
        grid-template-rows: auto;
        gap: 2rem;
        justify-items: start;
    }

    .site-name {
        font-size: 1.2rem;
        grid-column: 1;
        grid-row: 1;
        margin-right: 0;
        justify-self: start;
    }

    .main-nav {
        grid-column: 2;
        grid-row: 1;
        gap: 1rem;
        justify-content: flex-start;
    }

    .nav-link {
        font-size: 0.95rem;
    }

    .nav-link svg {
        width: 18px;
        height: 18px;
        stroke: var(--secondary);
    }

    .header-right {
        grid-column: 3;
        grid-row: 1;
        justify-self: end;
        align-self: center;
    }
}

/* Search container */
.search-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.4rem 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border-radius: 6px;
}

.search-toggle svg {
    width: 16px;
    height: 16px;
    stroke: #666;
    display: block;
    flex-shrink: 0;
}

.search-label {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

.search-input {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    padding: 0.5rem 0;
    border: none;
    border-bottom: 2px solid var(--accent);
    background: var(--bg);
    color: var(--text);
    font-size: 0.95rem;
    outline: none;
    opacity: 0;
    transition: width 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
    pointer-events: none;
}

.search-input.expanded {
    width: 200px;
    padding: 0.5rem 0.75rem;
    opacity: 1;
    pointer-events: all;
}

.search-toggle.hidden {
    opacity: 0;
    pointer-events: none;
}

.site-title {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 0rem;
}

nav {
    border-bottom: 1px solid var(--secondary);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

nav a {
    color: var(--link);
    text-decoration: none;
    margin-right: 1rem;
    font-weight: 500;
}

.note-meta {
    display: none;
}

.content-grid {
    display: block;
    width: 100%;
    max-width: 1000px;
}

/* Desktop: article and aside side-by-side */
@media screen and (min-width: 1080px) {
    .content-grid {
        display: flex;
        gap: 2rem;
        align-items: flex-start;
    }
}

article {
    max-width: 700px;
    width: 100%;
}

article hr {
    width: 100%;
    margin: 0.5rem 0 1rem 0;
    border: none;
    border-top: 1px solid #888888;
    opacity: 0.5;
}

aside hr {
    width: 100%;
    margin: 1rem 0 1rem 0;
    border: none;
    border-top: 1px solid #888888;
    opacity: 0.5;
}

.hr-light {
    opacity: 20%;
}

.hr-divider {
    border-top: 2px solid #222233;
    margin-bottom: 3rem;
}


h1 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-top: 0.5em;
    margin-bottom: 0.6em;
}

aside {
    font-size: 0.85em;
    text-align: center;
}

aside > h1 {
    font-size: 1.0em;
    color: #666666;
}

footer {
    font-size: 0.85em;
    text-align: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #888888;
    opacity: 0.8;
    width: 100%;
    max-width: 1000px;
}

footer hr {
    width: 100%;
    margin: 1rem 0 1rem 0;
    border: none;
    border-top: 1px solid #888888;
    opacity: 0.5;
}

footer p {
    font-size: 1em;
    margin-top: 0.5em;
    margin-bottom: 0.5em;
}

h2 {
    font-size: 1rem;
    margin-bottom: 0.5em;
    font-weight: 500;
}

h3 {
    font-size: 1rem;
    margin-bottom: 0.5em;
    font-weight: 400;
}

h4 {
    font-size: 1rem;
    margin-bottom: 0.5em;
    font-weight: 400;
}

.profile-section {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.profile-image img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 1px solid var(--accent);
    width: 100px;
    height: 100px;
    float: left;
    margin-right: 1rem;
}

.image-left-float {
    float: left;
    margin-right: 1rem;
}

.image-left-float img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 1px solid var(--accent);
}

.image-left-float figcaption {
    display: none;
}

.image-right-float {
    float: right;
    margin-left: 1rem;
}

.image-right-float img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 1px solid var(--accent);
}

.image-right-float figcaption {
    display: none;
}

.news-list {
    list-style: none;
}

.news-list li {
    margin-bottom: 1rem;
    line-height: 1.4;
}

.date {
    color: var(--secondary);
    font-size: 0.9em;
}

.paper-title {
    font-weight: 600;
    font-size: 0.95em;
}
.video-center {
    margin-top: 1em;
    margin-bottom: 1em;
    max-width: 100%;
}

.image-center {
    margin: 1rem 0.5rem 0rem 0rem;
    max-width: 100%;
}

.paper img {
    border: 1px dotted #aaaaaa;
}

.image-center img {
    width: 100%;
    border-radius: 10px;
    height: auto;
    display: block;
    margin-bottom: 0.5rem;
    border: 1px dotted #ddd;
}

.image-center figcaption {
    font-size: 0.8rem;
    font-style: italic;
    color: #666;
    text-align: center;
    line-height: 1.4;
    margin-bottom: 1.5rem;
}

.image-right {
    float: right;
    margin: 0 0 1rem 2rem;
    width: 40%;
    max-width: 400px;
    clear: right;
}

.image-right img {
    width: 100%;
    border-radius: 8px;
    height: auto;
    display: block;
    margin-bottom: 0.5rem;
}

.image-right figcaption {
    font-size: 0.75rem;
    font-style: italic;
    color: #666;
    text-align: center;
    line-height: 1.4;
}

.video-embed {
    margin-bottom: 1.4em;
}

/* Style for blockquotes with overlapping quote marks */
blockquote {
    position: relative;
    padding: 0.5rem 1rem;
    padding-top:0;
    margin: 0.5rem 0;
    border-left: 4px solid #cdc;
    font-style: italic;
    padding-bottom: 0.1em;
}

blockquote cite {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.9em;
    color: #666;
    font-style: normal;
}

blockquote p {
    position: relative;
}

/* Hide sidenotes in noquote blockquotes (used in paper listings) */
blockquote.noquote {
    border-left: none;
    font-style: normal;
    padding: 0;
    margin: 0;
}

/* Prevent sidenotes from rendering in noquote blockquotes to avoid whitespace */
blockquote.noquote .sidenote__content {
    display: none !important;
}

/* Hide sidenote markers in noquote blockquotes */
blockquote.noquote .sidenote__button::after {
    display: none !important;
}

.inline-icon {
    display: inline-block;
    vertical-align: middle;
    margin-left: 0.1em;
    margin-bottom: 0.1em;
    margin-right: 0.1em;
    height: 0.8em;
    width: 0.8em;
    opacity: 50%;
    border: 0 !important;
}


.invert {
    filter: invert(100%);
}

.feed-toggle {
    display: inline-flex;
    border: 1px dotted #ccc;
    border-radius: 10px;
    margin-right: 1rem;
    overflow: hidden;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.feed-toggle-option {
    padding: 1px 8px;
    cursor: pointer;
    background: #f5f5f5;
    user-select: none;
}

.feed-toggle-inline .feed-toggle-option {
    padding: 0;
    background: none;
    border: 0px;
    border-right: 0px !important; 
    text-decoration: underline;
    text-underline-offset: 0.15em;
    text-decoration-thickness: 0.05em;
    text-decoration-style: dotted;
}

.feed-toggle-option:first-child {
    border-right: 1px solid #ccc;
}

.feed-toggle-option.active {
    background: var(--link);
    color: white;
}

.feed-toggle-option:not(.active):hover {
    background: #e9e9e9;
}

.home-button {
    font-size: 1.2em;
}

a[href] span.hash-prefix {
  color: gray;
  font-size: 0.6em;
  margin-right: 0px;
  display: none;
}

.show-mobile { display: none; }

small.credits {
  color: #242;
}
small.credits a[href] {
  color: #226;
}

/* Table styling */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.9em;
    background-color: var(--bg);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

table th,
table td {
    padding: 0.75rem 1rem;
    text-align: left;
    vertical-align: top;
}

table th {
    background-color: var(--header-bg);
    font-weight: 400;
    color: var(--accent);
    border-bottom: 1px solid var(--accent);
    white-space: nowrap;
}

table tr {
    border-bottom: 1px dashed #e5e5e5;
}

table tr:last-child {
    border-bottom: none;
}

table tr:hover {
    background-color: rgba(0,0,0,0.02);
}

table td {
    line-height: 1.2;
}

table td:first-child {
    font-weight: 400;
}

/* Style contact links within tables */
table .contact {
    margin-right: 0.5rem;
    font-size: 0.95em;
}

/* Responsive table */
@media (max-width: 768px) {
    table {
        font-size: 0.85em;
    }
    
    table th,
    table td {
        padding: 0.5rem 0.75rem;
    }
    
    /* Allow wrapping on mobile */
    table th {
        white-space: normal;
    }
}


@media (max-width: 768px) {
    .profile-image {
        display: none;
    }
    .content-image {
        width: 50%;
        margin: 1rem 0;
    }
    article {
        max-width: 100%;
    }
    header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .hr-divider { margin-bottom: 2rem; }
    nav a {
        margin: 0 0.75rem;
    }

    .profile-section {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

@media (max-width: 428px) {
    .image-right {
        float: none;
        width: 100%;
        max-width: none;
        margin: 1.5rem 0;
    }
    .show-mobile { display: inline; }
    .hide-mobile { display: none; }
    .profile-image {
        display: none;
    }
    .content-image {
        width: 100%;
        margin: 1rem 0;
    }
    pre {
      max-width: 350px;
    }
    .hr-divider { margin-bottom: 0.5rem; }
    .paper-meta,
    .note-meta {
        white-space: normal;
    }
}

/* Sidenotes styling */
.sidenote {
  display: inline;
  font-size: 1em; /* Override the global aside font-size */
}

/* Make sidenote trigger text selectable, but not the popup content */
.sidenote__button {
  user-select: text;
  -webkit-user-select: text;
  -moz-user-select: text;
}

.sidenote__content {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
}

/* Override hidden attribute for sidenote UI elements - reader modes strip this CSS so hidden stays effective there */
/* In normal mode with CSS: checkbox stays hidden, content visible */
/* In reader mode without CSS: both actually hidden due to [hidden] attribute */
.sidenote__checkbox[hidden] {
  display: none !important;
}

/* Match the normal .sidenote__content display behavior when overriding hidden */
@media screen and (min-width: 1080px) {
  .sidenote__content[hidden] {
    display: block !important;
  }
}

@media screen and (max-width: 1079px) {
  .sidenote__content[hidden] {
    position: absolute !important;
    left: -99999px !important;
  }
}

/* Number markers for sidenotes - using data attributes for unlimited numbers */
/* Only show when checkbox is present (not hidden) - hides in reader mode */
.sidenote__checkbox[hidden] ~ .sidenote__button::after {
  content: attr(data-sidenote-number);
  display: inline-block;
  color: var(--link);
  font-size: 0.75em;
  vertical-align: super;
  line-height: 0;
  font-weight: 600;
}

.sidenote__checkbox {
  display: none;
}


/* For narrow viewports, the sidenote is hidden by default and shown when the checkbox is checked. */
@media screen and (max-width: 1079px) {

  .sidenote__checkbox~.sidenote__content {
    /* Hidden, but accessible to browsers that don't do CSS (e.g. screenreaders, Pocket) */
    position: absolute;
    left: -99999px;
    top: auto;
  }

  .sidenote__checkbox:checked~.sidenote__content {
    /* override hidden-but-accessible */
    position: relative !important;
    left: auto !important;

    /* Don't break up line containing the sidenote */
    float: left;
    min-width: 100%;

    display: block !important;
    margin: 0.8rem 0;
    padding: 0.8rem 1.6rem;
    font-size: 0.9em;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
  }

  /* Mobile sidenote styling - compact inline display */
  .sidenote__checkbox:checked~.sidenote__content .sidenote-number {
    float: none;
    display: inline;
    margin-left: 0;
    margin-right: 0.3em;
    width: auto;
    font-weight: 700;
  }

  /* Scale down icons for mobile inline display */
  .sidenote__checkbox:checked~.sidenote__content .sidenote-icon {
    display: inline-block;
    vertical-align: middle;
    margin-right: 0.4em;
  }

  .sidenote__checkbox:checked~.sidenote__content .sidenote-icon svg {
    width: 1em;
    height: 1em;
  }

  /* Hide thumbnail images on mobile - they're for desktop hover only */
  .sidenote__checkbox:checked~.sidenote__content .contact-face,
  .sidenote__checkbox:checked~.sidenote__content .paper-thumbnail,
  .sidenote__checkbox:checked~.sidenote__content .project-thumbnail {
    display: none;
  }

  .sidenote__button {
    color: var(--link);
    text-decoration: underline;
    text-decoration-style: dotted;
    cursor: pointer;
  }

  .sidenote__button:not(:hover):focus::after {
    display: inline;
  }

  .sidenote__checkbox:checked~.sidenote__button::after {
    content: none;
  }
}

@media screen and (min-width: 1080px) {
  .sidenote {
    cursor: default;
  }

  /* Hide duplicate sidenote boxes on desktop - only first occurrence shows in margin */
  .sidenote-reference .sidenote__content {
    display: none !important;
  }

  .sidenote:hover .sidenote__button::after,
  .sidenote:hover .sidenote__content::before {
    color: #ff5599;
  }

  .sidenote:hover .sidenote__button {
    background-color: #fff3cc;
    border-radius: 3px;
    padding: 0 3px;
    margin: 0 -3px;
  }

  /* Hover states for sidenote content */
  .sidenote:hover .sidenote__content {
    color: var(--text);
  }

  .sidenote:hover .sidenote-icon svg {
    stroke: var(--link);
  }

  .sidenote:hover .sidenote-number {
    color: var(--link);
  }

  .sidenote:hover .sidenote__content {
    border-color: rgba(0, 119, 204, 0.4);
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }

  .sidenote:hover .sidenote__content a {
    color: var(--link);
  }

  /* Sidenote number as actual HTML element - flows inline with content */
  .sidenote-number {
    display: inline;
    color: #888;
    font-size: 0.9em;
    font-weight: 600;
    margin-right: 0.2em;
  }

  /* Sidenote icon - type indicator (comes after number) */
  .sidenote-icon {
    display: inline-block;
    vertical-align: middle;
    margin-right: 0.4em;
  }

  .sidenote-icon svg {
    width: 0.9em;
    height: 0.9em;
    display: block;
    stroke: #888;
  }

  .sidenote__content {
    display: block;
    position: relative;
    float: right;
    clear: right;

    /* Push into the right margin area beyond the main content */
    margin-right: calc(-1 * (18rem + 2rem));
    margin-top: -0.3em;
    margin-bottom: 1rem;
    width: 19rem;

    font-size: 0.85em;
    color: #777;
    line-height: 1.4;
    padding: 0.4rem 0.6rem 0.4rem 1.1rem;
    text-align: left;
    box-sizing: border-box;
    /* Add transparent border to reserve space */
    border: 1px solid transparent;
    border-radius: 6px;
  }

  /* Lists in sidenotes should match the sidenote text size */
  .sidenote__content ul,
  .sidenote__content ol {
    font-size: 1em;
    margin: 0.25em 0;
    padding-left: 1.2em;
  }

  .sidenote__content li {
    margin-bottom: 0.25em;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  /* Make all links in sidenotes grey by default */
  .sidenote__content a {
    color: #777;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  /* Allow link text to wrap normally in list items */
  .sidenote__content li a {
    word-break: normal;
    white-space: normal;
  }

  /* Truncate long bare URLs in sidenotes */
  .sidenote__content a[href^="http"]:not(.sidenote__content li a) {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
  }

  .sidenote__content {
    position: relative;
  }

  .sidenote__button {
    position: relative;
  }

  /* Arrow pointing left from content box toward trigger */
  .sidenote:hover .sidenote__content::after {
    content: '';
    position: absolute;
    right: calc(100% + 0.4em);
    top: calc(0.2rem + 0.45em);
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-right: 10px solid var(--link);
    opacity: 1;
    pointer-events: none;
    z-index: 1;
  }

}


/* Contact sidenote styling */
.contact-info {
  display: inline;
}

/* Thumbnail styling - JavaScript controls display */
.contact-face {
  display: none;
  position: absolute;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
  border: 3px solid rgba(0, 0, 0, 0.5);
  filter: none;
  opacity: 0.95;
  z-index: 100;
  pointer-events: none;
}

.contact-details {
  display: inline;
}

.contact-name {
  font-weight: normal;
  color: #777;
  font-size: 0.95em;
  line-height: 1.4;
  transition: color 0.3s ease;
  display: inline;
}

.contact-delimiter-main {
  color: #bbb;
  font-size: 0.9em;
  display: inline;
}

.sidenote:hover .contact-name {
  color: var(--text);
}

.contact-links {
  font-size: 0.8em;
  line-height: 1.4;
  display: inline;
}

.contact-url {
  color: #777;
  text-decoration: none;
  transition: color 0.3s ease;
}

.sidenote:hover .contact-url {
  color: var(--link);
}

.contact-url:hover {
  text-decoration: underline;
}

.contact-delimiter {
  color: #bbb;
  font-size: 1em;
  padding: 0 0.1rem;
  transition: color 0.3s ease;
}

.sidenote:hover .contact-delimiter {
  color: #888;
}

.contact-icon {
  display: inline;
  text-decoration: none;
  color: #777;
  transition: color 0.3s ease;
}

.contact-icon svg {
  height: 1em;
  width: 1em;
  vertical-align: middle;
  fill: currentColor;
  display: inline-block;
}

.sidenote:hover .contact-icon {
  color: var(--link);
}

.contact-icon:hover {
  color: var(--text);
}


/* Paper sidenote styling */
.paper-info {
  display: inline;
}

/* Thumbnail styling - JavaScript controls display */
.paper-thumbnail {
  display: none;
  position: absolute;
  max-width: 140px;
  max-height: 180px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0, 0, 0, 0.2);
  filter: none;
  opacity: 0.95;
  z-index: 100;
  width: 90px;
  height: 90px;
  pointer-events: none;
}

.paper-details {
  display: inline;
}

.paper-title-line {
  line-height: 1.4;
  display: inline;
}

.paper-title {
  font-weight: normal;
  color: #666;
  font-size: 0.95em;
  transition: color 0.3s ease;
  display: inline;
}

.sidenote:hover .paper-title {
  color: var(--text);
}

.paper-meta {
  font-size: 0.85em;
  color: #888;
  font-weight: normal;
  transition: color 0.3s ease;
  white-space: nowrap;
  display: inline;
}

.sidenote:hover .paper-meta {
  color: #555;
}

.paper-doi {
  font-size: 0.8em;
  color: #888;
  text-decoration: none;
  transition: color 0.3s ease;
  white-space: nowrap;
  display: inline;
}

.sidenote:hover .paper-doi {
  color: var(--link);
}

.paper-doi:hover {
  text-decoration: underline;
}

.paper-delimiter {
  color: #ddd;
  font-size: 0.9em;
}

/* Idea sidenote styling */
.idea-info {
  display: inline;
}

.idea-title {
  font-weight: normal;
  color: #666;
  font-size: 0.95em;
  transition: color 0.3s ease;
  display: inline;
}

.sidenote:hover .idea-title {
  color: var(--text);
}

.idea-meta {
  font-size: 0.85em;
  color: #999;
  transition: color 0.3s ease;
  white-space: nowrap;
  display: inline;
}

.sidenote:hover .idea-meta {
  color: #666;
}

/* Note sidenote styling */
.note-info {
  display: inline;
}

.note-title {
  font-weight: normal;
  color: #666;
  font-size: 0.95em;
  transition: color 0.3s ease;
  display: inline;
}

.sidenote:hover .note-title {
  color: var(--text);
}

.note-meta {
  font-size: 0.85em;
  color: #999;
  transition: color 0.3s ease;
  white-space: nowrap;
  display: inline;
}



/* Project sidenote styling */
.project-info {
  display: inline;
}

/* Thumbnail styling - JavaScript controls display */
.project-thumbnail {
  display: none;
  position: absolute;
  max-width: 140px;
  max-height: 180px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0, 0, 0, 0.2);
  filter: none;
  opacity: 0.95;
  z-index: 100;
  width: 90px;
  height: 90px;
  pointer-events: none;
}

.project-details {
  display: inline;
}

.project-title-line {
  line-height: 1.4;
  display: inline;
}

.project-title {
  font-weight: normal;
  color: #666;
  font-size: 0.95em;
  transition: color 0.3s ease;
  display: inline;
}

.sidenote:hover .project-title {
  color: var(--text);
}

.project-meta {
  font-size: 0.85em;
  color: #999;
  transition: color 0.3s ease;
  white-space: nowrap;
  display: inline;
}

.sidenote:hover .project-meta {
  color: #666;
}

.project-delimiter {
  color: #ddd;
  font-size: 0.9em;
}

.project-ideas {
  font-size: 0.85em;
  font-style: italic;
  color: #aaa;
  transition: color 0.3s ease;
  display: inline;
}

.sidenote:hover .project-ideas {
  color: #888;
}

/* Video sidenote styling */
.video-info {
  display: inline;
}

/* Footnote sidenote styling - make all content inline */
.sidenote__content--footnote p,
.sidenote__content--footnote div,
.sidenote__content--footnote ul,
.sidenote__content--footnote ol,
.sidenote__content--footnote li,
.sidenote__content--footnote blockquote {
  display: inline;
  margin: 0;
  padding: 0;
}

.sidenote__content--footnote li::before {
  content: " • ";
}

.video-title {
  font-weight: normal;
  color: #666;
  transition: color 0.3s ease;
  display: inline;
}

.sidenote:hover .video-title {
  color: var(--text);
}

.video-meta {
  font-size: 0.85em;
  color: #999;
  transition: color 0.3s ease;
  white-space: nowrap;
  display: inline;
}

.sidenote:hover .video-meta {
  color: #666;
}

/* Search Modal Styles */
.search-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  animation: fadeIn 0.2s ease;
}

.search-modal.visible {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.search-modal-content {
  background: var(--bg);
  border-radius: 8px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
  width: 90%;
  max-width: 700px;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.search-modal-header {
  padding: 1.25rem 1.5rem 0.75rem;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.search-filters {
  padding: 0.5rem 1.5rem 0.75rem;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.search-filters-controls {
  display: flex;
  gap: 0.25rem;
  margin-right: 0.5rem;
  padding-right: 0.5rem;
  border-right: 1px solid #ddd;
}

.search-filter-toggle {
  padding: 0.25rem 0.5rem;
  border: 1px solid #ddd;
  background: #f8f9fa;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  color: #666;
  font-weight: 500;
}

.search-filter-toggle:hover {
  background: #e9ecef;
  border-color: #adb5bd;
}

.search-filter {
  padding: 0.25rem 0.6rem;
  border: 2px solid #e0e0e0;
  background: #f8f9fa;
  border-radius: 16px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  color: #999;
  font-weight: 500;
}

.search-filter:hover {
  border-color: #ccc;
  background: #fff;
}

.search-filter.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.search-filter.active:hover {
  background: #000;
  border-color: #000;
}

.search-modal-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1.1rem;
  background: transparent;
  color: var(--text);
}

.search-modal-input::placeholder {
  color: #999;
}

.search-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #666;
  padding: 0.25rem 0.5rem;
  line-height: 1;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.search-modal-close:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.search-modal-body {
  overflow-y: auto;
  padding: 0;
  flex: 1;
}

.search-results {
  list-style: none;
  padding: 0;
  margin: 0;
}

.search-result-item {
  padding: 0.2rem 0.5rem;
  border-bottom: 1px dotted #f0f0f0;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.search-result-item:hover,
.search-result-item.selected {
  background-color: #f8f9fa;
  transform: translateX(4px);
}

.search-result-item.selected {
  border-left: 3px solid var(--accent);
  padding-left: calc(1rem - 3px);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-compact {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.search-result-thumbnail-wrapper {
  position: relative;
  flex-shrink: 0;
  width: 72px;
  height: 72px;
}

.search-result-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  background: #f5f5f5;
  border: 2px solid transparent;
  transition: border-color 0.3s ease;
}

.search-result-item:hover .search-result-thumbnail,
.search-result-item.selected .search-result-thumbnail {
  border-color: var(--accent);
}

.search-result-type-badge {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  pointer-events: none;
}

.search-result-type-badge svg {
  width: 14px;
  height: 14px;
  color: #666;
}

.search-result-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #e8e8e8;
  transition: all 0.3s ease;
}

.search-result-icon svg {
  display: block;
  width: 24px;
  height: 24px;
}

.search-result-icon-large svg {
  width: 28px;
  height: 28px;
}

.search-result-icon.type-papers,
.search-result-icon.type-notes,
.search-result-icon.type-videos,
.search-result-icon.type-projects,
.search-result-icon.type-news,
.search-result-icon.type-ideas,
.search-result-icon.type-contacts {
  background: #e8e8e8;
  color: #666;
}

.search-result-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.search-result-title {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.3;
  transition: color 0.2s ease;
}

.search-result-item:hover .search-result-title,
.search-result-item.selected .search-result-title {
  color: var(--accent);
}

.search-result-meta {
  font-size: 0.8rem;
  color: #999;
  line-height: 1.3;
}

.search-result-relevance {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--relevance-color, #ccc);
  margin-left: 0.5em;
  opacity: 0.6;
  flex-shrink: 0;
}

.search-result-relevance-score {
  display: none;
}

.search-result-relevance-bar {
  display: none;
}

.search-result-relevance-bar > div {
  display: none;
}

.search-empty-state {
  padding: 3rem 1.5rem;
  text-align: center;
  color: #999;
}

.search-loading {
  padding: 2rem 1.5rem;
  text-align: center;
  color: #999;
}

.search-loading-more {
  padding: 1rem 1.5rem;
  text-align: center;
  color: #999;
  font-size: 0.9rem;
  border-top: 1px solid #f0f0f0;
  background: #fafafa;
}

.search-empty {
  padding: 3rem 2rem;
  text-align: center;
  color: #666;
  background: #f8f9fa;
  border-radius: 8px;
  margin: 2rem;
  font-size: 0.95rem;
  line-height: 1.5;
}

.search-error {
  padding: 2rem 1.5rem;
  text-align: center;
  color: #d32f2f;
}

.search-modal-footer {
  padding: 0.75rem 1.5rem;
  border-top: 1px solid #e0e0e0;
  font-size: 0.8rem;
  color: #999;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.search-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.search-status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4caf50;
  animation: pulse 2s ease-in-out infinite;
}

.search-status-indicator.searching {
  background: #2196f3;
  animation: pulse 0.8s ease-in-out infinite;
}

.search-status-indicator.error {
  background: #f44336;
  animation: none;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(0.9);
  }
}

.search-status-text {
  font-size: 0.85rem;
  color: #666;
}

.search-keyboard-hint {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.search-keyboard-hint kbd {
  padding: 0.2rem 0.4rem;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 3px;
  font-family: monospace;
  font-size: 0.75rem;
}

@media (max-width: 768px) {
  .search-modal.visible {
    padding-top: 2rem;
  }

  .search-modal-content {
    width: 95%;
    max-height: 80vh;
  }

  .search-modal-header {
    padding: 1rem;
  }

  .search-result-item {
    padding: 0.875rem 1rem;
  }

  .search-keyboard-hint {
    display: none;
  }
}

/* Backlinks Sidebar */
@media screen and (min-width: 1080px) {
  .backlinks-sidebar {
    display: block;
    position: relative;
    float: right;
    clear: right;
    margin-right: calc(-1 * (18rem + 2rem));
    margin-top: -0.3em;
    margin-bottom: 1rem;
    width: 18rem;
    font-size: 0.85em;
    color: #777;
    line-height: 1.4;
    padding: 0.6rem 0.8rem;
    text-align: left;
    box-sizing: border-box;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background-color: #fafafa;
  }

  .backlinks-sidebar h2 {
    font-size: 0.95em;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5em;
    margin-top: 0;
  }

  .backlinks-sidebar p {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 0.5em;
    font-style: italic;
  }

  .backlinks-sidebar ul {
    list-style: disc;
    padding-left: 1.2rem;
    margin: 0;
    font-size: 1em;
  }

  .backlinks-sidebar li {
    margin-bottom: 0.4em;
    line-height: 1.3;
  }

  .backlinks-sidebar a {
    color: var(--link);
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
}

@media screen and (max-width: 1079px) {
  .backlinks-sidebar {
    display: none;
  }
}

/* Related Items */
.related-items {
  margin: 2rem 0;
}

.related-items-heading {
  font-size: 1rem;
  margin-bottom: 0.5em;
  font-weight: 500;
  color: var(--text);
}

.related-items-list {
  list-style: disc;
  padding: 0;
  padding-left: 1rem;
  margin: 0 0 1rem 0;
  list-style-position: outside;
}

.related-item {
  margin-bottom: 0.5em;
}

.related-item-link {
  display: inline;
  text-decoration: none;
  color: var(--link);
  transition: opacity 0.2s;
}

.related-item-link:hover {
  opacity: 0.7;
}

.related-item-content {
  display: inline;
  align-items: baseline;
  gap: 0.25rem;
}

.related-item-thumbnail-container {
  display: none;
}

.related-item-thumbnail {
  display: none;
}

.related-item-icon {
  display: inline-block;
  vertical-align: middle;
  margin-right: 0.35rem;
}

.related-item-icon svg {
  width: 16px;
  height: 16px;
  stroke: var(--secondary);
  opacity: 0.7;
  display: block;
}

.related-item-type-overlay {
  display: none;
}

.related-item-text {
  display: inline;
}

.related-item-title {
  display: inline;
  font-size: 0.9em;
  font-weight: 400;
  color: var(--link);
}

.related-item-meta {
  display: inline;
  font-size: 0.85rem;
  color: var(--secondary);
  font-style: italic;
}

.related-items-search-more {
  display: inline;
  margin-top: 0.5rem;
  padding: 0;
  background-color: transparent;
  border-radius: 0;
  text-decoration: underline;
  text-decoration-style: dotted;
  color: var(--link);
  font-size: 0.9em;
  transition: opacity 0.2s;
}

.related-items-search-more:hover {
  opacity: 0.7;
  background-color: transparent;
}

/* Image expansion functionality */
.content-image-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
}

.content-image-wrapper > a {
  display: block;
  width: 100%;
}

.content-expand-icon {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  background-color: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, background-color 0.2s;
  z-index: 10;
  pointer-events: all;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="20" height="20" fill="none" stroke="white" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><circle cx="14" cy="14" r="12" /><path d="M23 23 L30 30" /><path d="M14 10 L14 18 M10 14 L18 14" /></svg>');
  background-repeat: no-repeat;
  background-position: center;
  background-size: 20px 20px;
}

.content-image-wrapper:hover .content-expand-icon {
  opacity: 1;
}

.content-expand-icon:hover {
  background-color: rgba(0, 0, 0, 0.8);
}

/* Modal/Lightbox */
.content-image-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.content-image-modal.active {
  display: flex;
}

.content-image-modal-content {
  max-width: 95%;
  max-height: 95%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.content-image-modal-image {
  max-width: 100%;
  max-height: calc(95vh - 80px);
  object-fit: contain;
  display: block;
}

.content-image-modal-caption {
  color: white;
  font-size: 1rem;
  text-align: center;
  max-width: 800px;
  padding: 0 20px;
}

.content-image-modal-caption a {
  color: white;
  text-decoration: underline;
  cursor: pointer;
}

.content-image-modal-caption a:hover {
  opacity: 0.8;
}

.content-image-modal-close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 40px;
  font-weight: 300;
  color: white;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  line-height: 1;
  transition: opacity 0.2s;
}

.content-image-modal-close:hover {
  opacity: 0.7;
}

.content-image-modal-loading {
  color: white;
  font-size: 1.2rem;
}

/* Make figure elements position relative for proper icon positioning */
figure.image-right,
figure.image-center,
figure.image-left-float,
figure.image-right-float {
  position: relative;
}

/* Ensure wrapper works in figures */
figure .content-image-wrapper {
  width: 100%;
}

/* Status filter styling for ideas page */
.status-filter {
  margin: 1.5em 0 2em 0;
  padding: 0.5em;
  background-color: #f8f8f8;
  border-radius: 1rem;
  border: 1px solid #e0e0e0;
  text-align: left;
}

.status-filter h3 {
  font-size: 0.85em;
  font-weight: 600;
  margin: 0 0 0.75em 0;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: left;
}

.status-filter label {
  display: block;
  margin-bottom: 0.5em;
  font-size: 0.85em;
  cursor: pointer;
  user-select: none;
  text-align: left;
}

.status-filter input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin-right: 0.35em;
  vertical-align: middle;
  cursor: pointer;
}

.status-filter .status-label {
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

.project-section {
  margin-bottom: 3em;
}

.ideas-list {
  margin-top: 1em;
}

.idea-item {
  margin-bottom: 0.75em;
  line-height: 1.5;
}

/* Projects Timeline */
.projects-timeline {
  position: relative;
  margin: 2em 0;
  padding-left: 80px;
}

/* Vertical timeline spine */
.projects-timeline::before {
  content: '';
  position: absolute;
  left: 38px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(to bottom,
    var(--accent) 0%,
    var(--accent) 20%,
    rgba(0, 119, 204, 0.5) 80%,
    rgba(0, 119, 204, 0.2) 100%);
}

/* Individual project on timeline */
.timeline-project {
  position: relative;
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.0em;
  align-items: flex-start;
}

/* Timeline marker section (dot + duration + year) */
.timeline-marker-wrapper {
  position: absolute;
  left: -106px;
  top: 0;
  width: 80px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding-right: 8px;
  z-index: 2;
}

/* Dot on timeline */
.timeline-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--bg);
  border: 3px solid var(--accent);
  position: relative;
  transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
  box-shadow: 0 0 0 0 rgba(0, 119, 204, 0);
  margin-bottom: 2px;
  will-change: transform;
}

.timeline-project:hover .timeline-dot {
  background-color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 8px rgba(0, 119, 204, 0.2);
  transform: scale(1.3);
}

.timeline-project:hover .timeline-duration {
  background: linear-gradient(to bottom,
    var(--accent) 0%,
    rgba(0, 119, 204, 0.7) 100%);
}

/* Year label - vertical alongside axis */
.timeline-year {
  font-size: 0.7em;
  font-weight: 500;
  color: var(--accent);
  transition: color 0.3s ease;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  margin-right: 0.5rem;
}

.timeline-project:hover .timeline-year {
  color: var(--link);
}

/* Project card */
.project-card {
  flex: 1;
  background-color: #fafafa;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 0.75em;
  min-width: 0;
  transition: border-color 0.3s ease, transform 0.3s ease;
  position: relative;
  will-change: transform;
}

.timeline-project:hover .project-card {
  border-color: var(--accent);
  transform: translateX(4px);
}

/* Connector line from timeline to card */
.project-card::before {
  content: '';
  position: absolute;
  left: -38px;
  top: 5px;
  width: 38px;
  height: 2px;
  background-color: #e0e0e0;
  transition: all 0.3s ease;
}

.timeline-project:hover .project-card::before {
  background-color: var(--accent);
  width: 38px;
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1em;
  margin-bottom: 0.5em;
}

.project-card h3 {
  font-size: 0.95em;
  margin: 0;
  line-height: 1.3;
  font-weight: 700;
  flex: 1;
}

.project-card h3 a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s ease;
}

.project-card h3 a:hover {
  color: var(--link);
}

.project-dates {
  font-size: 0.75em;
  font-weight: 600;
  color: #999;
  white-space: nowrap;
  transition: color 0.3s ease;
}

.timeline-project:hover .project-dates {
  color: var(--accent);
}

/* Thumbnail floats left, text flows around */
.project-card .image-left-float {
  margin: 0 0.75rem 0.5rem 0;
}

.project-body {
  font-size: 0.9em;
  line-height: 1.5;
  margin: 0.5em 0 0.75em 0;
}

.project-body p:first-child {
  margin-top: 0;
}

/* Recent items display */
.project-recent-items {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1em;
  margin-top: 0.75em;
  font-size: 0.85em;
  clear: both;
}

/* Suppress sidenotes in project cards to prevent layout interference */
@media screen and (min-width: 1080px) {
  .project-card .sidenote__content {
    display: none !important;
  }

  .project-card .sidenote__button::after {
    display: none !important;
  }
}

.project-recent-column h4 {
  font-size: 0.9em;
  font-weight: 600;
  margin: 0 0 0.5em 0;
  color: #666;
}

.project-recent-column ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.project-recent-column li {
  margin-bottom: 0.4em;
  line-height: 1.3;
}

.project-recent-column a {
  color: var(--link);
  text-decoration: none;
}

.project-recent-column a:hover {
  text-decoration: underline;
}

/* Mobile: stack recent items */
@media screen and (max-width: 1079px) {
  .project-recent-items {
    grid-template-columns: 1fr;
    gap: 0.75em;
  }
}

/* Mobile: simplified layout */
@media screen and (max-width: 1079px) {
  .projects-timeline {
    padding-left: 30px;
  }

  .projects-timeline::before {
    left: 10px;
  }

  .timeline-marker-wrapper {
    left: -30px;
    width: 30px;
  }

  .timeline-dot {
    width: 10px;
    height: 10px;
    border-width: 2px;
  }

  .timeline-year {
    font-size: 0.7em;
    writing-mode: horizontal-tb;
    text-orientation: initial;
  }

  .project-card::before {
    left: -15px;
    width: 15px;
  }

  .timeline-project:hover .project-card {
    transform: translateX(2px);
  }

  .project-card {
    padding: 0.6em;
  }

  .project-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25em;
  }
}

/* Recent notes section */
  margin-top: 1.5em;
  padding-top: 1em;
  border-top: 1px solid #e0e0e0;
}

.project-references h4 {
  font-size: 0.95em;
  font-weight: 600;
  margin: 0 0 0.75em 0;
  color: #666;
}

.project-references .paper {
  margin-bottom: 0.75em;
}

/* Activity section */
.activity-list {
  margin-top: 1em;
  list-style: none;
  padding: 0;
}

.activity-list li {
  margin-bottom: 1em;
  line-height: 1.6;
}

.activity-list .inline-icon {
  width: 16px;
  height: 16px;
  vertical-align: text-bottom;
  margin-right: 0.35em;
}

.activity-list a {
  color: var(--link);
  text-decoration: none;
  font-weight: 500;
}

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

.activity-description {
  color: var(--secondary);
}
