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

  :root {
    --bg: #f5f1ec;
    --surface: #fdfcf9;
    --surface-float: #ffffff;
    --border: #e6dfd6;
    --border-light: #f0ebe5;
    --text: #1c1814;
    --text-secondary: #5e5650;
    --text-muted: #978e86;
    --text-dim: #b8afa6;
    --accent: #b8836a;
    --accent-hover: #ca9479;
    --accent-deep: #a06d55;
    --accent-cool: #7d97a3;
    --accent-mauve: #9e7d88;
    --accent-green: #708573;
    --accent-gold: #b8965a;
    --glow: rgba(184, 131, 106, 0.08);
    --glow-strong: rgba(184, 131, 106, 0.18);
    --shadow-sm: 0 1px 3px rgba(28,24,20,0.04), 0 1px 2px rgba(28,24,20,0.03);
    --shadow-md: 0 4px 12px rgba(28,24,20,0.05), 0 2px 4px rgba(28,24,20,0.03);
    --shadow-lg: 0 8px 30px rgba(28,24,20,0.06), 0 3px 8px rgba(28,24,20,0.03);
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', sans-serif;
    --font-display: 'Instrument Serif', Georgia, 'Times New Roman', serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
  }

  html { scroll-behavior: smooth; }
  body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
  }
  a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
  a:hover { color: var(--accent-hover); text-decoration: underline; }
  ::selection { background: var(--accent); color: white; }

  /* noise texture overlay from reference aesthetic */
  body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.025;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
  }

  .top-nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    background: rgba(245, 241, 236, 0.82);
    backdrop-filter: blur(16px) saturate(1.3);
    -webkit-backdrop-filter: blur(16px) saturate(1.3);
    border-bottom: 0.5px solid var(--border);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 52px;
  }
  .nav-left { display: flex; align-items: center; gap: 20px; }
  .nav-logo {
    font-family: var(--font-display);
    font-size: 17px;
    font-style: italic;
    color: var(--accent);
    letter-spacing: 0.02em;
  }
  .nav-links { display: flex; gap: 18px; }
  .nav-links a {
    font-size: 12px;
    font-weight: 450;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    transition: color 0.2s;
    position: relative;
  }
  .nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px; left: 0;
    width: 0; height: 1.5px;
    background: var(--accent);
    transition: width 0.25s ease;
  }
  .nav-links a:hover { color: var(--text); text-decoration: none; }
  .nav-links a:hover::after { width: 100%; }
  .nav-right { display: flex; align-items: center; gap: 6px; }
  .lang-btn {
    font-size: 11px;
    font-weight: 500;
    padding: 5px 11px;
    border-radius: 6px;
    border: 0.5px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-body);
    letter-spacing: 0.04em;
  }
  .lang-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    font-weight: 500;
  }
  .lang-btn:not(.active):hover {
    border-color: var(--accent);
    color: var(--text);
    background: var(--glow);
  }

  /* ========== Two-Column Layout ========== */
  .page-wrap {
    max-width: 1120px;
    margin: 0 auto;
    padding: 80px 24px 60px;
    display: grid;
    grid-template-columns: 270px 1fr;
    gap: 48px;
  }

  @media (max-width: 840px) {
    .page-wrap {
      grid-template-columns: 1fr;
      gap: 24px;
    }
  }

  /* ========== Sidebar ========== */
  .sidebar {
    position: relative;
  }
  @media (min-width: 841px) {
    .sidebar {
      position: sticky;
      top: 80px;
      align-self: start;
      max-height: calc(100vh - 100px);
      overflow-y: auto;
    }
  }

  .sidebar-inner {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  /* Photo Carousel */
  .photo-carousel {
    position: relative;
    width: 190px;
    height: 190px;
    margin: 0 auto 10px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--surface-float);
    box-shadow: var(--shadow-lg), 0 0 0 5px rgba(253,252,249,0.6);
    flex-shrink: 0;
  }
  .carousel-track {
    display: flex;
    transition: transform 0.45s cubic-bezier(0.33, 1, 0.68, 1);
    height: 100%;
  }
  .carousel-slide {
    width: 100%;
    height: 100%;
    flex-shrink: 0;
    object-fit: cover;
    object-position: center 30%;
    display: block;
  }
  .carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 0.5px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    transition: all 0.2s;
    opacity: 0;
    z-index: 2;
  }
  .photo-carousel:hover .carousel-btn {
    opacity: 1;
  }
  .carousel-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--surface-float);
  }
  .carousel-prev { left: 4px; }
  .carousel-next { right: 4px; }
  .carousel-dots {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 4px;
  }
  .carousel-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255,255,255,0.6);
    transition: all 0.25s;
    cursor: pointer;
    border: none;
  }
  .carousel-dot.active {
    background: white;
    transform: scale(1.2);
  }

  .sidebar-name {
    font-family: var(--font-display);
    font-size: 28px;
    font-style: italic;
    color: var(--text);
    line-height: 1.15;
    text-align: center;
  }
  .sidebar-alt {
    font-size: 11.5px;
    color: var(--text-muted);
    text-align: center;
    letter-spacing: 0.05em;
    margin-top: -4px;
  }
  .sidebar-affil {
    font-size: 12px;
    color: var(--accent);
    text-align: center;
    font-weight: 450;
    margin-top: 2px;
  }
  .sidebar-bio {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.65;
    text-align: center;
    padding: 0 4px;
  }
  .sidebar-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
  }
  .sidebar-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }
  .sidebar-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: var(--text-muted);
    background: var(--surface);
    border: 0.5px solid var(--border);
    transition: all 0.2s ease;
  }
  .sidebar-icon:hover {
    color: var(--accent);
    background: var(--surface-float);
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
  }
  .sidebar-icon svg { display: block; }
  .cv-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 500;
    padding: 5px 14px;
    border-radius: 8px;
    color: var(--accent);
    background: rgba(184, 131, 106, 0.06);
    border: 0.5px solid rgba(184, 131, 106, 0.15);
    transition: all 0.2s;
    text-decoration: none;
    margin: 0 auto;
  }
  .cv-link:hover {
    background: rgba(184, 131, 106, 0.12);
    border-color: var(--accent);
    transform: translateY(-1px);
    text-decoration: none;
  }
  .sidebar-divider {
    height: 0.5px;
    background: var(--border);
    margin: 4px 0;
  }

  /* ========== Main Content ========== */
  .main-content {
    min-width: 0;
  }

  .tag {
    font-size: 11px;
    font-weight: 450;
    padding: 4px 12px;
    border-radius: 100px;
    letter-spacing: 0.03em;
    border: 0.5px solid transparent;
  }
  .tag-accent { background: rgba(184, 131, 106, 0.1); color: var(--accent); border-color: rgba(184, 131, 106, 0.2); }
  .tag-cool  { background: rgba(125, 151, 163, 0.1); color: var(--accent-cool); border-color: rgba(125, 151, 163, 0.2); }
  .tag-mauve { background: rgba(158, 125, 136, 0.1); color: var(--accent-mauve); border-color: rgba(158, 125, 136, 0.2); }
  .tag-green { background: rgba(112, 133, 115, 0.1); color: var(--accent-green); border-color: rgba(112, 133, 115, 0.2); }
  .tag-gold  { background: rgba(184, 150, 90, 0.1); color: var(--accent-gold); border-color: rgba(184, 150, 90, 0.2); }

  .sidebar-icon-link { color: var(--text-muted); font-size: 12px; transition: color 0.2s; }
  .sidebar-icon-link:hover { color: var(--accent); text-decoration: none; }

  /* Section */
  .section { margin: 40px 0; }
  .section-lg { margin: 48px 0; }
  .section-sm { margin: 28px 0; }
  .section-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
  }
  .section-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-style: italic;
    color: var(--text);
    white-space: nowrap;
  }
  .section-title-lg {
    font-family: var(--font-display);
    font-size: 22px;
    font-style: italic;
    color: var(--text);
    white-space: nowrap;
  }
  .section-rule {
    flex: 1;
    height: 0.5px;
    background: linear-gradient(90deg, var(--border) 0%, transparent 100%);
  }

  /* Research Overview */
  .research-overview {
    padding: 24px;
    background: var(--surface);
    border: 0.5px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    position: relative;
  }
  .research-overview::before {
    content: '';
    position: absolute;
    top: -1px; left: 15%; right: 15%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    border-radius: 2px;
  }
  .research-overview p {
    font-size: 13.5px;
    line-height: 1.75;
    color: var(--text-secondary);
    margin-bottom: 12px;
  }
  .research-overview p:last-child { margin-bottom: 0; }
  .research-areas {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 14px;
  }

  /* News Timeline */
  .news-timeline {
    position: relative;
    padding-left: 20px;
  }
  .news-timeline::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 4px;
    bottom: 4px;
    width: 1.5px;
    background: var(--border);
  }
  .news-item {
    position: relative;
    padding: 0 0 16px 16px;
    display: flex;
    flex-direction: row;
    gap: 6px;
  }
  .news-item:last-child { padding-bottom: 0; }
  .news-item::before {
    content: '';
    position: absolute;
    left: -17px;
    top: 6px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--bg);
    z-index: 1;
  }
  .news-date {
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--accent);
    letter-spacing: 0.02em;
    white-space: nowrap;
    flex-shrink: 0;
    padding-top: 2px;
  }
  .news-content {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.6;
  }
  .news-content strong { color: var(--text); font-weight: 500; }
  .news-tags { display: inline-flex; margin-right: 4px; vertical-align: middle; }
  .news-tag {
    display: inline-block;
    font-size: 9px;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 3px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
  }
  .news-tag.pub { background: rgba(184, 131, 106, 0.15); color: #b8836a; }
  .news-tag.role { background: rgba(70, 130, 180, 0.12); color: #4682b4; }
  .news-tag.leave { background: rgba(220, 120, 140, 0.15); color: #dc788c; }
  .news-tag.award { background: rgba(80, 160, 120, 0.12); color: #50a078; }
  .news-tag.talk { background: rgba(140, 110, 180, 0.12); color: #8c6eb4; }
  .news-tag.poster { background: rgba(220, 160, 80, 0.15); color: #d4a04e; }

  /* Publication Cards — Unified Showcase Component */
  .pub-showcase {
    background: var(--surface);
    border: 0.5px solid var(--border);
    border-radius: 14px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    overflow: hidden;
    cursor: pointer;
    position: relative;
  }
  .pub-showcase:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 24px rgba(28,24,20,0.07);
    border-color: var(--accent);
  }
  .pub-showcase-inner {
    padding: 22px 24px;
    display: flex;
    gap: 20px;
    align-items: flex-start;
  }
  @media (max-width: 640px) {
    .pub-showcase-inner { flex-direction: column; padding: 18px; gap: 14px; }
  }
  .pub-thumb {
    width: 100px;
    height: 100px;
    border-radius: 10px;
    flex-shrink: 0;
    overflow: hidden;
    background: var(--bg);
    border: 0.5px solid var(--border-light);
  }
  .pub-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
  .pub-thumb-duo {
    display: flex;
    gap: 4px;
    width: 120px;
    height: 100px;
    flex-shrink: 0;
  }
  .pub-thumb-duo img {
    width: 50%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    border: 0.5px solid var(--border-light);
  }
  .pub-body { flex: 1; min-width: 0; }
  .pub-body-title {
    font-family: var(--font-display);
    font-size: 16px;
    font-style: italic;
    color: var(--text);
    line-height: 1.4;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .pub-body-title a { color: inherit; text-decoration: none; }
  .pub-body-title a:hover { color: var(--accent); text-decoration: underline; }
  .pub-body-authors {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .pub-body-venue {
    font-size: 11.5px;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 8px;
  }
  .pub-body-venue .venue-tag {
    display: inline-block;
    font-style: normal;
    font-size: 10px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 4px;
    background: rgba(184, 131, 106, 0.1);
    color: var(--accent);
    border: 0.5px solid rgba(184, 131, 106, 0.2);
  }
  .pub-body-snip {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.55;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .pub-body-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .pub-body-links a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 6px;
    text-decoration: none;
    color: var(--accent);
    background: rgba(184, 131, 106, 0.06);
    border: 0.5px solid rgba(184, 131, 106, 0.15);
    transition: background 0.2s ease, border-color 0.2s ease;
    position: relative;
    z-index: 2;
  }
  .pub-body-links a:hover {
    background: rgba(184, 131, 106, 0.12);
    border-color: rgba(184, 131, 106, 0.3);
    text-decoration: none;
  }
  .pub-showcase.clickable::after {
    content: '→';
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: var(--text-dim);
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
  }
  .pub-showcase.clickable:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(3px);
    color: var(--accent);
  }

  /* Entries */
  .entry {
    margin-bottom: 16px;
    padding: 18px 20px;
    background: var(--surface);
    border: 0.5px solid var(--border);
    border-radius: 12px;
    border-left: 3px solid var(--accent);
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  }
  .entry:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--accent); }
  .entry-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px;
  }
  .entry-org {
    font-family: var(--font-display);
    font-size: 15px;
    font-style: italic;
    color: var(--text);
  }
  .entry-date {
    font-size: 10.5px;
    color: var(--text-dim);
    font-family: var(--font-mono);
    white-space: nowrap;
    letter-spacing: 0.02em;
  }
  .entry-role {
    font-size: 12px;
    color: var(--accent);
    font-weight: 450;
    margin: 2px 0 6px;
  }
  .entry-bullets { padding-left: 16px; }
  .entry-bullets li {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: 3px;
    list-style: none;
    position: relative;
  }
  .entry-bullets li::before {
    content: '';
    position: absolute;
    left: -16px;
    top: 9px;
    width: 4px; height: 4px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.4;
  }

  /* Projects */
  .timeline-sub {
    margin: 10px 0 6px 20px;
    padding: 0;
  }
  .timeline-sub .tl-item {
    position: relative;
    padding: 0 0 14px 18px;
    border-left: 2px solid var(--border);
  }
  .timeline-sub .tl-item:last-child {
    border-left-color: transparent;
    padding-bottom: 0;
  }
  .timeline-sub .tl-item::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 5px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-cool);
    border: 2px solid var(--bg);
  }
  .tl-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 4px;
  }
  /* Education */
  .edu-card {
    background: var(--surface);
    border: 0.5px solid var(--border);
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 10px;
    border-left: 3px solid var(--accent-mauve);
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  }
  .edu-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--accent-mauve); }
  .edu-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px;
  }
  .edu-school {
    font-family: var(--font-display);
    font-size: 15px;
    font-style: italic;
    color: var(--text);
  }
  .edu-degree {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
    line-height: 1.4;
  }
  .edu-date {
    font-size: 10.5px;
    color: var(--text-dim);
    font-family: var(--font-mono);
    white-space: nowrap;
  }
  .edu-gpa {
    font-size: 10.5px;
    color: var(--text-muted);
    margin-top: 1px;
  }

  /* Honors */
  .honors-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
  }
  .honor-item {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.5;
    padding: 6px 8px 6px 22px;
    position: relative;
  }
  .honor-item:hover { }
  .honor-item::before {
    content: '—';
    position: absolute;
    left: 6px;
    top: 6px;
    color: var(--accent-mauve);
    opacity: 0.5;
  }
  .honor-item strong { color: var(--text); font-weight: 500; }

  .repo-footnote {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 8px;
  }
  .repo-footnote a {
    color: var(--accent);
    font-family: var(--font-display);
    font-style: italic;
    text-decoration: none;
  }
  .repo-footnote a:hover { color: var(--accent-hover); text-decoration: underline; }

  /* ========== Project Detail View ========== */
  #view-project { display: none; }
  body.project-view #view-home { display: none; }
  body.project-view #view-project { display: block; }
  body.project-view .top-nav { display: none; }
  body.project-view .footer { display: none; }
  body.project-view .page-wrap { padding-top: 0; }

  .project-detail {
    padding: 24px 0;
  }
  .back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 450;
    color: var(--text-muted);
    margin-bottom: 28px;
    padding: 6px 14px;
    border-radius: 8px;
    background: var(--surface);
    border: 0.5px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
  }
  .back-link:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--glow);
    text-decoration: none;
  }
  .project-detail-header {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 0.5px solid var(--border);
  }
  .project-detail-title {
    font-family: var(--font-display);
    font-size: 28px;
    font-style: italic;
    line-height: 1.25;
    color: var(--text);
    margin-bottom: 12px;
  }
  .project-detail-meta {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 8px;
  }
  .project-detail-meta strong {
    font-weight: 500;
    color: var(--text);
  }
  .project-detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 10px 0;
  }
  .project-links-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
  }
  .project-links-bar a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11.5px;
    font-weight: 500;
    padding: 5px 14px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--accent);
    background: rgba(184, 131, 106, 0.06);
    border: 0.5px solid rgba(184, 131, 106, 0.15);
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  }
  .project-links-bar a:hover {
    background: rgba(184, 131, 106, 0.12);
    border-color: rgba(184, 131, 106, 0.3);
    transform: translateY(-1px);
    text-decoration: none;
  }
  .project-detail-section {
    margin-bottom: 28px;
  }
  .project-detail-section h3 {
    font-family: var(--font-display);
    font-size: 18px;
    font-style: italic;
    color: var(--text);
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 0.5px solid var(--border-light);
  }
  .project-detail-section p {
    font-size: 13.5px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 8px;
  }
  .project-detail-section ul {
    margin: 6px 0 6px 18px;
    padding: 0;
  }
  .project-detail-section ul li {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 3px;
  }
  .project-figure {
    margin: 16px 0;
    padding: 16px;
    background: var(--surface);
    border: 0.5px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    text-align: center;
  }
  .project-figure img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
    margin: 0 auto;
  }
  .project-figure figcaption {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 8px;
    line-height: 1.4;
  }
  .project-figure-placeholder {
    padding: 40px 20px;
    background: var(--bg);
    border-radius: 8px;
    color: var(--text-dim);
    font-size: 12px;
    border: 1px dashed var(--border);
  }

  .pub-card.clickable {
    cursor: pointer;
    position: relative;
  }
  .pub-card.clickable::after {
    content: '→';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: var(--text-dim);
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
  }
  .pub-card.clickable:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(3px);
    color: var(--accent);
  }
  .pub-card.clickable:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 16px rgba(184, 131, 106, 0.1);
    transform: translateY(-3px);
  }
  .pub-card.clickable .pub-card-links a {
    position: relative;
    z-index: 2;
  }

  @media (max-width: 640px) {
    .project-detail-title { font-size: 22px; }
    .project-detail-section h3 { font-size: 16px; }
    .project-figure { padding: 10px; }
    .nav-links a[data-project] { display: none; }
  }

  .lang-content { display: none; }
  .lang-content.active { display: block; }

  .footer {
    text-align: center;
    padding: 36px 0 16px;
    border-top: 0.5px solid var(--border);
    margin-top: 48px;
  }
  .footer-text {
    font-size: 11px;
    color: var(--text-dim);
    letter-spacing: 0.02em;
  }
  .footer-text a { color: var(--text-muted); }
  .footer-text a:hover { color: var(--accent); }

  .footer-contact {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
  }
  .footer-label {
    font-family: var(--font-display);
    font-size: 16px;
    font-style: italic;
    color: var(--text-muted);
    letter-spacing: 0.03em;
  }
  .footer-icons {
    display: flex;
    gap: 10px;
    justify-content: center;
  }
  .footer-copy {
    margin-top: 4px;
  }

  @media (max-width: 640px) {
    .page-wrap { padding: 72px 16px 40px; }

    .honors-grid { grid-template-columns: 1fr; }
    .entry-header { flex-direction: column; align-items: flex-start; }
    .top-nav { padding: 0 16px; height: 48px; }
    .nav-links { gap: 12px; }
    .nav-links a { font-size: 11px; }
    .section { margin: 32px 0; }
    .entry, .edu-card, .pub-card { padding: 14px 16px; }
  }

  .sidebar-inner { position: relative; }

  /* Cat companion — subtle decorative element beside avatar */
  .cat-companion {
    position: absolute;
    top: -12px;
    left: 20px;
    width: 120px;
    height: 120px;
    pointer-events: auto;
    cursor: grab;
    z-index: 1;
    animation: catFloat 5s ease-in-out infinite;
    user-select: none;
  }
  .cat-companion:active { cursor: grabbing; }
  .cat-companion img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
  }
  @keyframes catFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
  }
  @keyframes catBoop {
    0% { transform: scale(1) translateY(0); }
    30% { transform: scale(1.25) translateY(-8px); }
    60% { transform: scale(0.95) translateY(2px); }
    100% { transform: scale(1) translateY(0); }
  }

  /* Footer */
  .site-footer {
    text-align: center;
    padding: 60px 0 40px;
    max-width: 480px;
    margin: 0 auto;
  }
  .footer-ornament { margin-bottom: 24px; color: var(--accent); }
  .footer-heading {
    font-family: var(--font-display);
    font-size: 24px;
    font-style: italic;
    color: var(--text);
    margin-bottom: 16px;
    font-weight: 400;
  }
  .footer-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 8px;
  }
  .footer-tagline {
    font-size: 13px;
    color: var(--accent);
    font-style: italic;
    margin-bottom: 28px;
  }
  .footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 32px;
  }
  .footer-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12.5px;
    color: var(--text-secondary);
    padding: 4px 8px;
    border-radius: 6px;
    transition: color 0.2s;
    text-decoration: none;
  }
  .footer-link:hover {
    color: var(--accent);
    text-decoration: none;
  }
  .footer-link svg { flex-shrink: 0; }
  .footer-copy {
    font-size: 11px;
    color: var(--text-dim);
    font-family: var(--font-mono);
    letter-spacing: 0.04em;
  }
  .news-toggle {
    display: block;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-muted);
    padding: 8px 0 4px 20px;
    user-select: none;
    transition: color 0.2s;
  }
  .news-toggle:hover { color: var(--accent); }

/* ---- added by the i18n refactor ---------------------------------------- */
[hidden] { display: none !important; }
#view-project:empty { display: none; }
.boot-error {
  max-width: 640px; margin: 80px auto; padding: 24px 28px;
  border: 1px solid var(--border); border-radius: 10px;
  font-family: var(--font-body); color: var(--text); line-height: 1.6;
}
.boot-error code { font-size: 0.9em; }

/* Keep the language switcher reachable on project sub-pages. */
body.project-view .top-nav { display: flex; }
