:root {
  --cardinal: #750014;
  --very-light-cardinal: #fff2f4;
  --light-cardinal: #ff94a4;
  --dark-cardinal: #200000;
  --very-light-gray: #f1f1f1;
  --light-gray: #c2c0bf;
  --dark-gray: #8a8b8c;
  --very-dark-gray: #2d2d2d;

  --text: black;
  --background: white;

  --night-text: white;
  --night-background: #121414;

  --page-width: 768px;

  --font-size: 14px;
  --mobile-font-size: 16px;

  --line-height: 24px;
  --mobile-line-height: 26px;

  --section-title-font-size: 20px;
  --mobile-section-title-font-size: 22px;

  --name-font-size: 32px;

  --code-font-size: 12px;
  --code-line-height: 18px;
}

@font-face {
  font-family: 'Lato';
  src: url('../fonts/lato/Lato-Regular.woff2') format('woff2');
  font-style: normal;
  font-weight: normal;
  text-rendering: optimizeLegibility;
}

@font-face {
  font-family: 'Lato';
  src: url('../fonts/lato/Lato-Bold.woff2') format('woff2');
  font-style: normal;
  font-weight: bold;
  text-rendering: optimizeLegibility;
}
/* ---------- Razer-minimal diagonal sweep (theme-adaptive) ---------- */
:root{
  /* defaults if no theme attribute present */
  --sweep-accent: rgba(68,214,44,0.06); /* neon green whisper */
  --sweep-bg: #000000;                  /* dark default */
  --sweep-size: 160% 160%;
  --sweep-duration: 20s;
}

:root[data-bs-theme="light"]{
  /* lighter base + softer accent so content stays readable */
  --sweep-bg: #ffffff;
  --sweep-accent: rgba(68,214,44,0.04);
}

:root[data-bs-theme="dark"]{
  --sweep-bg: #000000;
  --sweep-accent: rgba(68,214,44,0.06);
}

/* OS-level fallback if you don't set data-bs-theme */
@media (prefers-color-scheme: light){
  :root:not([data-bs-theme]){
    --sweep-bg: #ffffff;
    --sweep-accent: rgba(68,214,44,0.04);
  }
}
@media (prefers-color-scheme: dark){
  :root:not([data-bs-theme]){
    --sweep-bg: #000000;
    --sweep-accent: rgba(68,214,44,0.06);
  }
}

/* The background */
.bg-sweep{
  position: fixed; inset: 0; z-index:-1; pointer-events:none;
  background:
    linear-gradient(135deg,
      var(--sweep-accent) 0%,
      rgba(0,0,0,0) 40%,
      var(--sweep-accent) 60%,
      rgba(0,0,0,0) 100%
    ),
    var(--sweep-bg);
  background-size: var(--sweep-size);
  animation: sweepMove var(--sweep-duration) ease-in-out infinite;
}

/* Motion accessibility */
@media (prefers-reduced-motion: reduce){ .bg-sweep{ animation:none; } }

@keyframes sweepMove{
  0%{ background-position: 0% 0%; }
  50%{ background-position: 100% 100%; }
  100%{ background-position: 0% 0%; }
}

/*  */
body {
  font-family: "Lato", "Helvetica Neue", Ubuntu, Arial, PingFang, SimHei, sans-serif;
  font-size: var(--font-size);
  line-height: var(--line-height);
  color: var(--text);
  font-weight: normal;
  background: var(--background);
}

[data-bs-theme=dark] body {
  color: var(--night-text);
  background: var(--night-background);
}

.blockquote {
  font-size: var(--font-size);
  line-height: var(--line-height);
}

body .container,
body .container-fluid {
  max-width: var(--page-width);
}

body .row {
  margin-left: 0;
  margin-right: 0;
  padding-left: 0;
  padding-right: 0;
}

b.zh {
  font-weight: 900;
}

a,
a:hover,
.highlight {
  color: var(--cardinal);
}

[data-bs-theme=dark] a,
[data-bs-theme=dark] a:hover,
[data-bs-theme=dark] .highlight {
  color: var(--light-cardinal);
}

a {
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.highlight {
  font-weight: bold;
}

.section-item {
  margin-top: 20px;
}

.section-head {
  margin-top: 30px;
}

.section-title {
  font-weight: normal;
  font-size: var(--section-title-font-size);
  line-height: var(--line-height);
  display: inline-block;
}

.col-wrapper {
  padding-left: 10px;
  padding-right: 10px;
}

.sec-wrapper {
  margin-top: 30px;
}

.section-sub {
  font-size: var(--font-size);
  line-height: var(--line-height);
  color: var(--dark-gray);
}

.representative {
  background-color: var(--very-light-cardinal);
  border-radius: 2px;
}

[data-bs-theme=dark] .representative {
  background-color: var(--dark-cardinal);
}

@media (max-width: 767.98px) {
  body {
    font-size: var(--mobile-font-size);
    line-height: var(--mobile-line-height);
  }

  .blockquote {
    font-size: var(--mobile-font-size);
    line-height: var(--mobile-line-height);
  }

  .section-title {
    font-size: var(--mobile-section-title-font-size);
    line-height: var(--mobile-line-height);
  }
}

@media (min-width: 768px) {
  .section-sub {
    padding-left: 0;
  }
}

/*------------------
 * Theme Toggle Button
 *------------------*/

.theme-toggle-btn {
  background: none;
  border: none;
  font-size: 16px;
  vertical-align: middle;
  transition: background-color 0.1s ease-in-out, color 0.1s ease-in-out;
  color: var(--text);
}

[data-bs-theme=dark] .theme-toggle-btn {
  color: var(--night-text);
}

.theme-toggle-btn:focus,
.theme-toggle-btn:active {
  outline: none;
  box-shadow: none;
  border: none;
}

/*-----------------
 * Home
 *-----------------*/

.home-wrapper .picture img {
  width: 100%;
  max-width: 200px;
  margin-right: 40px;
}

.home-wrapper .description {
  margin-top: 30px;
}

.home-wrapper .description .name {
  font-size: var(--name-font-size);
  margin-bottom: 20px;
}

.home-wrapper .social {
  margin-top: 10px;
  margin-bottom: 0;
  padding: 0;
}

/*------------------
 * Bio
 *------------------*/

.bio-wrapper .info,
.bio-wrapper .info:hover {
  color: var(--text);
  text-decoration: none;
}

[data-bs-theme=dark] .bio-wrapper .info,
[data-bs-theme=dark] .bio-wrapper .info:hover {
  color: var(--night-text);
}

.bio-wrapper .zh-name:hover {
  text-decoration: none;
  border-bottom: 1.5px dashed currentColor;
}

.bio-wrapper .name-icon {
  margin-left: -3px;
  margin-right: -3px;
}
.hi-name {
  font-family: "Noto Sans Devanagari", "Mangal", sans-serif;
  font-weight: 600;
}
/*------------------
 * Name
 *------------------*/

.name-wrapper .zh-a,
.name-wrapper .zh-a:hover {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1.5px dashed currentColor;
}

[data-bs-theme=dark] .name-wrapper .zh-a,
[data-bs-theme=dark] .name-wrapper .zh-a:hover {
  color: var(--night-text);
}

.name-wrapper .blockquote-footer {
  font-size: var(--font-size);
  line-height: var(--line-height);
  margin-top: 0;
  color: var(--dark-gray);
}

.name-wrapper .blockquote-footer .zh-a,
.name-wrapper .blockquote-footer .zh-a:hover,
.name-wrapper .blockquote-footer .en-a,
.name-wrapper .blockquote-footer .en-a:hover {
  color: currentColor;
}

.name-wrapper .blockquote-footer .en-a,
.name-wrapper .blockquote-footer .en-a:hover {
  text-decoration: underline;
  border-bottom: none;
}

/*------------------
 * Publications
 *------------------*/

.pub-wrapper .section-item {
  margin-top: 15px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.pub-wrapper a {
  color: var(--text);
}

[data-bs-theme=dark] .pub-wrapper a {
  color: var(--night-text);
}

.pub-wrapper .title a {
  font-weight: bold;
}

.pub-wrapper .link .venue {
  font-weight: bold;
}

.pub-wrapper .authors {
  color: var(--dark-gray);
}

.pub-wrapper .authors a {
  color: var(--dark-gray);
}

.pub-wrapper .authors me {
  font-weight: bold;
}

.pub-wrapper .figure img {
  max-width: 240px;
  width: 100%;
}
.pub-wrapper .authors .nolink {
  color: var(--dark-gray);         
}
@media (max-width: 767.98px) {
  .pub-wrapper .figure {
    margin-bottom: 10px;
  }
}

/*------------------
 * Bibtex
 *------------------*/

.snippet {
  position: relative;
  background: var(--very-light-gray);
  font-size: var(--code-font-size);
  line-height: var(--code-line-height);
  margin-top: 10px;
  margin-bottom: 0;
  border-radius: 2px;
}

[data-bs-theme=dark] .snippet {
  background: var(--very-dark-gray);
}

.representative .snippet {
  background: var(--background);
}

[data-bs-theme=dark] .representative .snippet {
  background: var(--night-background);
}

.snippet .btn {
  transition: opacity 0.1s ease-in-out, border-color 0.1s ease-in-out;
  opacity: 0.9;
  padding: 0.5px 4px;
  position: absolute;
  right: 4px;
  top: 4px;
  font-size: 14px;
  line-height: 21px;
  background-color: var(--background);
  border: 2px solid var(--light-gray);
  border-radius: 2px;
  color: var(--text);
}

[data-bs-theme=dark] .snippet .btn {
  background-color: var(--night-background);
  border-color: var(--dark-gray);
  color: var(--night-text);
}

.snippet .btn:hover {
  opacity: 1;
  background-color: var(--background);
  border-color: var(--dark-gray);
}

[data-bs-theme=dark] .snippet .btn:hover {
  background-color: var(--night-background);
  border-color: var(--light-gray);
}

.snippet .btn:active {
  opacity: 1;
  background-color: var(--very-light-gray);
  border-color: var(--dark-gray);
}

[data-bs-theme=dark] .snippet .btn:active {
  background-color: var(--very-dark-gray);
  border-color: var(--light-gray);
}

.snippet code {
  display: block;
  overflow-x: auto;
}

/*------------------
 * Experience
 *------------------*/

.exp-wrapper .title a {
  font-weight: bold;
}

.exp-wrapper a,
.exp-wrapper a:hover {
  color: var(--text);
}

[data-bs-theme=dark] .exp-wrapper a,
[data-bs-theme=dark] .exp-wrapper a:hover {
  color: var(--night-text);
}

.exp-wrapper .time {
  text-align: right;
}

.exp-wrapper .location {
  color: var(--dark-gray);
}

@media (max-width: 767.98px) {
  .exp-wrapper .time {
    text-align: left;
    color: var(--dark-gray);
  }

  .exp-wrapper .location {
    display: none;
  }
}

/*------------------
 * Footer
 *------------------*/

.citation {
  font-size: var(--code-font-size);
  line-height: var(--code-line-height);
  margin-top: 40px;
  margin-bottom: 30px;
  color: var(--dark-gray);
}

.citation p {
  margin-bottom: 0;
}

/* ===== Social icon sizing (bigger) ===== */
:root {
  --social-icon-size: 1.35rem;     /* tweak this to your taste */
  --social-icon-hover-scale: 1.18; /* popup strength on hover */
}

.social.icons a {
  text-decoration: none !important;   /* kill underline */
  display: inline-flex;
  align-items: center;
  margin-right: 12px;
  color: inherit;
  transition: transform 140ms ease, opacity 140ms ease;
  transform-origin: center bottom;
}

/* Increase size of all icons + CV */
.social.icons i,
.social.icons .cv-text {
  font-size: var(--social-icon-size);
  line-height: 1;
  vertical-align: middle;
}

/* Keep CV bold to read like an icon */
.social.icons .cv-text { font-weight: 800; }

/* Hover popup (no underline) */
.social.icons a:hover {
  transform: scale(var(--social-icon-hover-scale));
  opacity: 1;
}

/* Optional: slightly smaller on very small screens */
@media (max-width: 420px) {
  :root { --social-icon-size: 1.20rem; }
}

/* Floating button (top-right) */
.rs-fab {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 1085; /* above navbar/content, below modal (1055–1080 range ok) */
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--light-gray);
  border-radius: 999px;
  background: var(--background);
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

[data-bs-theme=dark] .rs-fab {
  background: var(--night-background);
  color: var(--night-text);
  border-color: var(--dark-gray);
}

.rs-fab i {
  font-size: 1.05rem; /* icon size */
}

.rs-fab:hover {
  transform: scale(1.06);
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
  border-color: var(--dark-gray);
}

/* Modal backdrop: blur page when open */
.modal-backdrop.show {
  backdrop-filter: blur(6px);
  background-color: rgba(0,0,0,0.18);
}

/* Modal aesthetics */
.rs-modal .modal-content {
  border-radius: 10px;
  overflow: hidden;
}

.rs-modal .modal-header {
  padding: 10px 14px;
}

.rs-modal .modal-title {
  font-weight: 700;
}

.rs-modal .btn-close {
  outline: none;
  box-shadow: none;
}

/* Narrow screens: make iframe a bit shorter */
@media (max-width: 576px) {
  .rs-modal .modal-body iframe { height: 70vh; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .rs-fab { transition: none; }
}
