/* Bilingual visibility — toggled by data-lang on <html>.
   Default treats elements without explicit lang class as language-neutral. */

html[data-lang="en"] .zh,
html[data-lang="en"] .lang-label-zh {
  display: none !important;
}

html[data-lang="zh"] .en,
html[data-lang="zh"] .lang-label-en {
  display: none !important;
}

/* Subtitle bilingual spans should not stack to next line. */
.post-title .en,
.post-title .zh {
  display: inline;
}

/* Language toggle pill in navbar. */
#lang-toggle {
  background: transparent;
  border: 1px solid currentColor;
  border-radius: 9999px;
  padding: 0.1rem 0.55rem;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  line-height: 1.2;
  cursor: pointer;
  color: inherit;
  opacity: 0.7;
  transition: opacity 0.15s ease;
}

#lang-toggle:hover {
  opacity: 1;
}

/* One-line TLDR shown under each publication entry. */
.publications .tldr {
  font-size: 0.92em;
  opacity: 0.78;
  margin-top: 0.15rem;
  margin-bottom: 0.35rem;
  line-height: 1.45;
}

/* Original concept/result figures for the three sampler papers. */
.publications .publication-feature {
  width: min(100%, 42rem);
  margin: 0.85rem 0 0.75rem;
}

.publications .publication-feature figure {
  margin: 0;
}

.publications .publication-feature picture {
  display: block;
}

.publications .publication-feature-image {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
  border: 1px solid var(--global-divider-color);
  border-radius: 4px;
}

.publications .publication-feature-caption {
  margin-top: 0.4rem;
  color: var(--global-text-color-light);
  font-size: 0.78rem;
  line-height: 1.45;
}

.publications .publication-feature-secondary {
  width: min(100%, 32rem);
  margin-top: 0.65rem;
}

@media (max-width: 575px) {
  .publications .publication-feature {
    width: 100%;
    margin-top: 0.7rem;
  }
}

/* "Lines I admire" — small collection of external quotes I keep coming
   back to. Distinct from .motto (which is my own credo, italic, solid
   left border): regular weight, dotted left border, with a small
   attribution / source line at the bottom. */
.quotes {
  margin: 1.6rem 0 0.4rem;
  font-size: 0.95em;
  line-height: 1.55;
}
.quotes > p:first-child {
  margin-bottom: 0.4rem;
  opacity: 0.85;
}
.quotes blockquote {
  margin: 0.5rem 0;
  padding: 0.15rem 0 0.15rem 0.8rem;
  border-left: 2px dotted currentColor;
  opacity: 0.78;
  font-style: normal;
  /* Kill the theme's solid blockquote backing: the full-width slab runs
     under the floated profile card and visually cuts the affiliation. */
  background: transparent;
}
.quotes blockquote p {
  margin: 0;
}
.quotes .src {
  display: block;
  margin-top: 0.6rem;
  font-size: 0.82em;
  font-style: italic;
  opacity: 0.55;
}

/* "Now" block — what I'm currently reading / listening to, etc.
   Deliberately styled differently from .motto (no border, no italics)
   so the two don't read as a pair. */
.now {
  margin: 1.4rem 0 0.4rem;
  font-size: 0.92em;
  opacity: 0.72;
  line-height: 1.55;
}
.now p {
  margin: 0;
}
.now p + p {
  margin-top: 0.15rem;
}

/* Homepage-only background. Official key visual:
   https://tv.violet-evergarden.jp/special/gallery/ */
.violet-home {
  position: relative;
  isolation: isolate;
}

.violet-home::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  content: "";
  pointer-events: none;
  background-image: url("/assets/img/violet-evergarden-bg.jpg");
  background-repeat: no-repeat;
  background-position: center top;
  background-size: cover;
  opacity: 0.17;
}

html[data-theme="dark"] .violet-home::before {
  filter: brightness(0.7) saturate(0.75);
  opacity: 0.12;
}

/* Page-specific character backgrounds for the main navigation sections. */
.anime-page {
  position: relative;
  isolation: isolate;
}

.anime-page::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  content: "";
  pointer-events: none;
  background-image: var(--page-background);
  background-repeat: no-repeat;
  background-position: var(--page-background-position, center center);
  background-size: cover;
  opacity: var(--page-background-opacity, 0.11);
}

.page-bg-youzitsu {
  --page-background: url("/assets/img/page-backgrounds/classroom-of-the-elite-wide-clean.png");
  --page-background-position: center center;
  --page-background-opacity: 0.12;
}

.page-bg-kaoruhana {
  --page-background: url("/assets/img/page-backgrounds/fragrant-flower-rintaro-kaoruko.jpg");
  --page-background-position: center center;
  --page-background-opacity: 0.11;
}

.page-bg-kimiuso {
  --page-background: url("/assets/img/page-backgrounds/your-lie-in-april.jpg");
  --page-background-position: center center;
  --page-background-opacity: 0.12;
}

.page-bg-charlotte {
  --page-background: url("/assets/img/page-backgrounds/charlotte.jpg");
  --page-background-position: center 13%;
  --page-background-opacity: 0.1;
}

.page-bg-quintuplets {
  --page-background: url("/assets/img/page-backgrounds/quintessential-quintuplets-study.png");
  --page-background-position: center center;
  --page-background-opacity: 0.1;
}

.page-bg-aobuta {
  --page-background: url("/assets/img/page-backgrounds/rascal-mai-sakuta.jpg");
  --page-background-position: center center;
  --page-background-opacity: 0.1;
}

.page-bg-erii {
  --page-background: url("/assets/img/page-backgrounds/dragon-raja-erii-cherry-blossom.webp");
  --page-background-position: center 45%;
  --page-background-opacity: 0.1;
}

.page-bg-weizhuang {
  --page-background: url("/assets/img/page-backgrounds/qins-moon-weizhuang.jpg");
  --page-background-position: 58% center;
  --page-background-opacity: 0.1;
}

html[data-theme="dark"] .anime-page::before {
  filter: brightness(0.68) saturate(0.78);
  opacity: 0.075;
}

@media (max-width: 767px) {
  .violet-home::before {
    background-position: 28% top;
    opacity: 0.07;
  }

  html[data-theme="dark"] .violet-home::before {
    opacity: 0.055;
  }

  .anime-page::before {
    opacity: 0.07;
  }

  .page-bg-youzitsu::before {
    background-image: url("/assets/img/page-backgrounds/classroom-of-the-elite.webp");
    background-position: center top;
    background-size: contain;
  }

  .page-bg-kaoruhana::before {
    background-position: center top;
    background-size: auto 52vh;
  }

  .page-bg-kimiuso::before {
    background-position: 30% center;
  }

  .page-bg-charlotte::before {
    background-position: 68% 56px;
    background-size: auto calc(100vh - 24px);
  }

  .page-bg-quintuplets::before {
    background-position: center top;
    background-size: auto 42vh;
  }

  .page-bg-aobuta::before {
    background-position: center top;
    background-size: auto 45vh;
  }

  .page-bg-erii::before {
    background-position: 38% top;
    background-size: auto 52vh;
  }

  .page-bg-weizhuang::before {
    background-position: 62% 56px;
    background-size: auto 48vh;
  }

  html[data-theme="dark"] .anime-page::before {
    opacity: 0.05;
  }
}

/* Personal motto / epigraph used at the bottom of the bio. */
.motto {
  margin: 1.6rem 0 0.4rem;
  padding: 0.6rem 1rem;
  border-left: 3px solid currentColor;
  opacity: 0.7;
  font-style: italic;
  line-height: 1.55;
}
.motto p {
  margin: 0;
}
.motto p + p {
  margin-top: 0.4rem;
}

/* Slide-cover previews on the talks page. */
.talk-cover-link {
  display: block;
  margin: 0.4rem 0 1rem;
  line-height: 0;
}

.talk-cover-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid var(--global-divider-color);
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(42, 31, 38, 0.12);
  transition:
    box-shadow 160ms ease,
    transform 160ms ease;
}

.talk-cover-link:hover .talk-cover-image,
.talk-cover-link:focus-visible .talk-cover-image {
  box-shadow: 0 10px 28px rgba(42, 31, 38, 0.18);
  transform: translateY(-1px);
}

/* Conference, school, and research-visit timeline. */
.journey-list {
  margin: 1.5rem 0 2rem;
}

.journey-group-title {
  margin: 0;
  color: var(--global-text-color-light);
  font-size: 1rem;
  font-weight: 600;
}

.journey-entry {
  display: grid;
  grid-template-columns: 9.5rem minmax(0, 1fr);
  gap: 1.5rem;
  padding: 1.2rem 0;
  border-top: 1px solid var(--global-divider-color);
}

.journey-date,
.journey-details p {
  margin: 0;
}

.journey-date {
  color: var(--global-theme-color);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.journey-details h3 {
  margin: 0 0 0.2rem;
  font-size: 1.15rem;
}

.journey-event-type {
  color: var(--global-text-color);
  font-weight: 600;
}

.journey-details p:last-child {
  margin-top: 0.35rem;
  color: var(--global-text-color-light);
}

@media (max-width: 575px) {
  .journey-entry {
    grid-template-columns: 1fr;
    gap: 0.35rem;
    padding: 1rem 0;
  }
}

/* ============================================================
   Color palette override — "樱雨 / restrained sakura"
   ------------------------------------------------------------
   Whisper-of-pink cream in light mode, deep plum-charcoal in
   dark mode. Accent is a dried-petal deep rose, not a hot pink,
   so it stays academic-feeling. All colors go through the same
   --global-* variables the theme already exposes.
   ============================================================ */

:root {
  /* Paper with the faintest pink undertone. */
  --global-bg-color: #fdf6f5;
  --global-text-color: #2a1f26;
  --global-text-color-light: #7a6b74;

  /* Dried-petal deep rose. Links / hovers / badges. */
  --global-theme-color: #b93a5a;
  --global-hover-color: #b93a5a;
  --global-hover-text-color: #fdf6f5;

  --global-card-bg-color: #fffaf9;
  --global-divider-color: rgba(42, 31, 38, 0.08);
  --global-code-bg-color: rgba(185, 58, 90, 0.05);

  --global-highlight-color: #8a2843;

  /* Footer — inverted, warm-plum charcoal so it grounds the page. */
  --global-footer-bg-color: #2a1f26;
  --global-footer-text-color: #d8c8ce;
  --global-footer-link-color: #fdf6f5;
}

html[data-theme="dark"] {
  --global-bg-color: #1a1418;
  --global-text-color: #f5e6e4;
  --global-text-color-light: #a08a90;

  --global-theme-color: #eb8fa5;
  --global-hover-color: #eb8fa5;
  --global-hover-text-color: #1a1418;

  --global-card-bg-color: #221a1e;
  --global-divider-color: #3a2f34;
  --global-code-bg-color: #2a2126;

  --global-highlight-color: #f2b0c0;

  --global-footer-bg-color: #221a1e;
  --global-footer-text-color: #f5e6e4;
  --global-footer-link-color: #eb8fa5;
}

.profile .profile-image-caption {
  margin-top: 0.45rem;
  color: var(--global-text-color-light);
  font-size: 0.78rem;
  line-height: 1.4;
  text-align: center;
}
