/* Site colour system — light + dark. Active theme is html[data-theme] (see js/theme.js).
   Light : Cream #F3EEE3 (main) · Ink Black #111111 (text) · Burnt Orange, deepened to #BF450F (highlights)
   Dark  : Charcoal #1E1E1C (main) · Light cream #fdf9f0 (text) · Electric Blue #2F6BFF (highlights) */

html[data-theme="light"]{
  color-scheme:light;
  --bg:#F3EEE3; --text:#111111; --muted:#5f5a50; --line:#d8cfbd;
  --card:#ebe4d4; --card2:#e3dac6;
  --hl:#BF450F; --hl-text:#BF450F; --on-hl:#ffffff; --hl-soft:#f3d9cb;
  --hover:#BF450F;
}
html[data-theme="dark"]{
  color-scheme:dark;
  --bg:#1E1E1C; --text:#fdf9f0; --muted:#B5AC98; --line:#3b3a35;
  --card:#282826; --card2:#31312d;
  --hl:hsl(223, 100%, 66%); --hl-text:#7aa5ff; --on-hl:#ffffff; --hl-soft:#1d2a4d;
  --hover:#7aa5ff;
}
/* page-level custom properties used by the per-page stylesheets */
html[data-theme] *{
  --profile-accent:var(--hl-text);--profile-muted:var(--muted);--profile-line:var(--line);
  --education-accent:var(--hl-text);--education-muted:var(--muted);--education-line:var(--line);
  --experience-accent:var(--hl-text);--experience-muted:var(--muted);--experience-line:var(--line);
  --others-accent:var(--hl-text);--others-muted:var(--muted);
}

/* ---------- toggle button ---------- */
#theme-toggle{
  position:fixed;right:16px;bottom:16px;z-index:9999;
  width:40px;height:40px;border-radius:50%;
  border:2px solid var(--text);background:var(--text);color:var(--bg);cursor:pointer;
  font-size:19px;line-height:1;padding:0;display:flex;align-items:center;justify-content:center;
  box-shadow:0 2px 8px rgba(0,0,0,.2);transition:transform .2s ease;
}
#theme-toggle:hover{transform:scale(1.08)}
#theme-toggle:focus-visible{outline:2px solid var(--hl);outline-offset:2px}

/* ---------- base ---------- */
html[data-theme],
html[data-theme] body{background:var(--bg);color:var(--text)}
html[data-theme] a{color:var(--text);text-decoration-color:var(--hl)}
html[data-theme] a:hover{color:var(--hover);text-decoration-color:var(--hover)}
html[data-theme] #author-name,
html[data-theme] #author-name a{color:var(--text)}
html[data-theme] h1,html[data-theme] h2,html[data-theme] h3,html[data-theme] h4,
html[data-theme] strong,html[data-theme] b{color:inherit}
html[data-theme] hr{border-top:1px solid var(--line);border-bottom:0}
html[data-theme] table,html[data-theme] th,html[data-theme] td{background-color:transparent;color:var(--text)}
html[data-theme] .content blockquote{border-left-color:var(--hl);color:var(--muted)}
html[data-theme] .single-paper:hover,
html[data-theme] .single-paper-f:hover{color:var(--hover)}

/* ---------- side "Page Contents" ---------- */
html[data-theme] #navbar{background-color:var(--card);border-color:var(--line);box-shadow:0 2px 8px rgba(0,0,0,.18)}
html[data-theme] #navbar a{color:var(--muted)}
html[data-theme] #navbar a.active,
html[data-theme] #navbar a:hover{color:var(--hl-text)}

/* ---------- home: publication stats ---------- */
html[data-theme] .outer-box{background:var(--card);border-color:var(--hl)}
html[data-theme] .inner-box{background:var(--bg);border-color:var(--hl)}
html[data-theme] .outer-label,html[data-theme] .inner-label,
html[data-theme] .outer-label a,html[data-theme] .inner-label a{color:var(--text)}
html[data-theme] .tag{background:var(--hl);color:var(--on-hl)}
html[data-theme] .tag-x{background:var(--text);color:var(--bg)}

/* highlight badge (GOLD Reviewer / SPOTLIGHT) */
html[data-theme] .review-badge,
html[data-theme] .review-badge a,
html[data-theme] .review-badge a:hover{background-color:var(--hl);color:var(--on-hl) !important;text-decoration-color:var(--on-hl)}
html[data-theme] .review-badge a{background:transparent}

/* ---------- buttons / pills (all inline-coloured ones are unified) ---------- */
html[data-theme] .button-pdf,
html[data-theme] .button-pdfxx,
html[data-theme] .button-preprint,
html[data-theme] .button-workshop,
html[data-theme] .button-conference,
html[data-theme] .button-journal,
html[data-theme] .button-demo{background-color:var(--text) !important;color:var(--bg) !important}
html[data-theme] .button-pdf:hover,
html[data-theme] .button-pdfxx:hover{background-color:var(--hl) !important;color:var(--on-hl) !important}
html[data-theme] .button-pdfxx.selected{background-color:var(--hl) !important;color:var(--on-hl) !important;border:1.75px solid var(--hl);box-shadow:none}
html[data-theme] .button-pdf *,html[data-theme] .button-pdfxx *{color:inherit !important}

/* ---------- inline coloured text -> palette ---------- */
html[data-theme] [style*="color:rgb("]:not([style*="background"]),
html[data-theme] [style*="color: rgb("]:not([style*="background"]),
html[data-theme] [style*="color:brown"],
html[data-theme] [style*="color: brown"]{color:var(--hl-text) !important}
/* small inline-coloured tags (SPOTLIGHT, ORAL, ...) */
html[data-theme] :not(button)[style*="background-color:rgb("],
html[data-theme] :not(button)[style*="background-color: rgb("]{background-color:var(--hl) !important;color:var(--on-hl) !important}
html[data-theme] :not(button)[style*="background-color:rgb("] *,
html[data-theme] :not(button)[style*="background-color: rgb("] *{color:inherit !important}
html[data-theme] [style*="color:black"],html[data-theme] [style*="color: black"],
html[data-theme] [style*="color:#000"],html[data-theme] [style*="color: #161616"]{color:var(--text) !important}
html[data-theme] [style*="color:#555"]{color:var(--muted) !important}
html[data-theme] [style*="background-color:#f8f8f8"],html[data-theme] [style*="background-color: #f8f8f8"],
html[data-theme] [style*="background-color:#f5f2f2"],html[data-theme] [style*="background-color: #f5f2f2"],
html[data-theme] [style*="background-color:white"],html[data-theme] [style*="background-color: white"],
html[data-theme] [style*="background:#fff"],
html[data-theme] [style*="background-color: #f9f9f9"],html[data-theme] [style*="background-color:#f9f9f9"]{background-color:var(--card) !important;color:var(--text)}

/* ---------- profile pages (contact / cv) ---------- */
html[data-theme] .profile-page a{color:var(--hl-text)}
html[data-theme] .profile-page h3,html[data-theme] .profile-page .page-title{color:var(--text)}
html[data-theme] .contact-callout,html[data-theme] .cv-card,html[data-theme] .contact-button{background:var(--card);border-color:var(--line);color:var(--text)}
html[data-theme] .contact-button.primary{background:var(--hl);border-color:var(--hl);color:var(--on-hl) !important}
html[data-theme] .cv-toc a{color:var(--muted)}
html[data-theme] .cv-toc a:hover,html[data-theme] .cv-toc a:focus{color:var(--hl-text)}
html[data-theme] .profile-page .cv-card h2{border-bottom-color:var(--hl)}

/* ---------- education / experience / others ---------- */
html[data-theme] .education-content a,html[data-theme] .experience-content a,html[data-theme] .others-details a{text-decoration-color:var(--hl)}
html[data-theme] .education-content .degree-metrics > div,
html[data-theme] .education-content details,html[data-theme] .research-details,
html[data-theme] .experience-content .experience-tags span{background:var(--card) !important;border-color:var(--line);color:var(--text) !important}
html[data-theme] .experience-content .experience-tags span{color:var(--hl-text) !important}
html[data-theme] .education-content .degree-metrics > div{border-color:var(--hl)}
html[data-theme] .research-details *,html[data-theme] .education-content details *{color:var(--text)}
html[data-theme] .education-content > ul > li,
html[data-theme] .experience-content > ul > li,
html[data-theme] .others-details > ul > li,
html[data-theme] .others-details .others-cards > li,
html[data-theme] .others-details .others-interests > li{background:transparent !important;border-color:var(--line)}
html[data-theme] [class*="timeline"] > li{border-left-color:var(--line)}
html[data-theme] .education-content > ul.education-timeline > li::before,
html[data-theme] [class*="timeline"] > li::before,
html[data-theme] .travel-entry::before{background:var(--hl) !important;border-color:var(--hl);box-shadow:0 0 0 4px var(--bg)}
html[data-theme] .travel-entry{border-left-color:var(--line)}
html[data-theme] .others-details .travel-photo,
html[data-theme] .others-details .travel-photo img{border-color:var(--hl)}
html[data-theme] .others-details .others-cards li::marker,
html[data-theme] .experience-content > ul ul li::marker{color:var(--hl)}

/* ---------- publications ---------- */
html[data-theme] .core-section ol > li::before{background:transparent;color:var(--muted)}
html[data-theme] .core-section ol > li p.single-paper-f{color:var(--muted) !important}
html[data-theme] .core-section ol > li p.single-paper-f > a:first-child,
html[data-theme] .core-section ol > li p.single-paper-f > strong:first-child,
html[data-theme] .core-section ol > li p.single-paper-f > strong:first-child > a,
html[data-theme] .core-section ol > li p.single-paper-f > a:first-of-type strong,
html[data-theme] .core-section ol > li p.single-paper-f > strong > a:first-of-type{color:var(--text) !important}
html[data-theme] .core-section ol > li p.single-paper-f > a:first-child:hover,
html[data-theme] .core-section ol > li p.single-paper-f > strong:first-child:hover,
html[data-theme] .core-section ol > li p.single-paper-f > strong:first-child > a:hover,
html[data-theme] .core-section ol > li p.single-paper-f > a:first-of-type strong:hover,
html[data-theme] .core-section ol > li p.single-paper-f > strong > a:first-of-type:hover,
html[data-theme] .core-section ol > li p.single-paper-f a:not(:first-child):hover,
html[data-theme] .core-section ol > li p.single-paper-f a:not(:first-child):hover span,
html[data-theme] .core-section ol > li p.single-paper-f span.author-name:hover{color:var(--hover) !important;text-decoration-color:var(--hover)}
html[data-theme] .core-section ol > li p.single-paper-f a:not(:first-child),
html[data-theme] .core-section ol > li p.single-paper-f span{color:var(--muted) !important}
html[data-theme] .core-section ol > li p.single-paper-f span[style*="color"],
html[data-theme] .core-section ol > li p.single-paper-f span[style*="font-weight"]{color:var(--hl-text) !important}
html[data-theme] .core-section ol > li p.single-paper-f span[id="wasi-inpub"]{color:var(--text) !important}
html[data-theme] .publication-action-button,
html[data-theme] .publication-resource-link,
html[data-theme] .publication-copy-button{background:transparent;color:var(--muted) !important;border-color:var(--hl)}
html[data-theme] .publication-action-button:hover,
html[data-theme] .publication-action-button[aria-expanded="true"],
html[data-theme] .publication-action-button:focus-visible,
html[data-theme] .publication-resource-link:hover,
html[data-theme] .publication-resource-link:focus-visible,
html[data-theme] .publication-copy-button:hover{background:var(--hl);border-color:var(--hl);color:var(--on-hl) !important}
html[data-theme] .publication-box{background:var(--card);color:var(--muted);border-color:var(--line)}
html[data-theme] .publication-placeholder{color:var(--muted)}
html[data-theme] .publication-bibtex{color:var(--text)}
html[data-theme] .publication-circle{background:var(--card2);color:var(--muted)}

/* ---------- blog ---------- */
html[data-theme] .blog-item a,html[data-theme] .blog-item{color:var(--text)}
html[data-theme] .blog-project-list > li{background:var(--card);border-color:var(--line)}
html[data-theme] .blog-project-list h3,html[data-theme] .blog-project-list h3 a,
html[data-theme] .blog-project-list a[style*="color: #161616"]{color:var(--text) !important}
html[data-theme] .blog-project-list a:hover{color:var(--hover) !important}

/* ---------- code ---------- */
html[data-theme] .highlight pre,html[data-theme] pre,html[data-theme] .highlight .hll{background-color:var(--card);border-color:var(--line);color:var(--text)}
html[data-theme] code{background:var(--card);color:var(--hl-text)}
html[data-theme] pre code{background:transparent;color:inherit}
html[data-theme="dark"] .highlight .n,html[data-theme="dark"] .highlight .nn,html[data-theme="dark"] .highlight .gp{color:#fdf9f0}
html[data-theme="dark"] .highlight .c,html[data-theme="dark"] .highlight .cm,html[data-theme="dark"] .highlight .c1{color:#8a8070}
html[data-theme="dark"] .highlight .s{color:#e9a97a}
html[data-theme="dark"] .highlight .kt,html[data-theme="dark"] .highlight .nc,html[data-theme="dark"] .highlight .nt{color:#7aa5ff}
html[data-theme="dark"] .highlight .nf,html[data-theme="dark"] .highlight .ne{color:#9bb8ff}

/* dark-mode image softening */
html[data-theme="dark"] img{opacity:.93}
html[data-theme="dark"] img:hover{opacity:1}

/* coloured banner blocks in blog posts (inline background-color) */
html[data-theme] div[style*="background-color"]{background-color:var(--card) !important;color:var(--text) !important;border-left:5px solid var(--hl)}
html[data-theme] div[style*="background-color"] *{color:inherit !important}

/* filter pills: no focus ring for mouse clicks; keyboard focus keeps a themed ring */
html[data-theme] .button-pdfxx:focus:not(:focus-visible){outline:none}
html[data-theme] .button-pdfxx:focus-visible{outline:2px solid var(--hl);outline-offset:2px}

/* link-buttons (<a class="button-pdf">) inherit the page's 150% line-height and look taller than <button>s */
html[data-theme] .container.content a.button-pdf{line-height:normal}

/* profile photo: thin accent ring with a small gap */
html[data-theme] .content .profile-picture{box-sizing:content-box;border:2px solid var(--hl);padding:3px;background:var(--bg);box-shadow:none}

/* publication stats: tighter boxes */
html[data-theme] .outer-box{padding:3px 4px 4px;border-width:1.5px;border-radius:7px;line-height:1.3}
html[data-theme] .outer-label{margin:0 0 2px 3px;line-height:1.3}
html[data-theme] .inner-row{gap:3px}
html[data-theme] .inner-box{padding:2px 5px 4px;border-width:1.5px;border-radius:7px}
html[data-theme] .inner-label{margin:0 0 2px;line-height:1.3}
html[data-theme] .tags-row{gap:3px}
html[data-theme] .tag,html[data-theme] .tag-x{padding:0 6px;border-radius:6px;line-height:1.35}

/* paper titles: slightly smaller, closer to body text (home + publications) */
html[data-theme] .core-section ol > li p.single-paper-f > a:first-child,
html[data-theme] .core-section ol > li p.single-paper-f > strong:first-child,
html[data-theme] .core-section ol > li p.single-paper-f > strong:first-child > a,
html[data-theme] .core-section ol > li p.single-paper-f > a:first-of-type strong,
html[data-theme] .core-section ol > li p.single-paper-f > strong > a:first-of-type{font-size:17px;line-height:1.35}
