/* The public website, for pages other than the portfolio.
 *
 * Every value here is one portfolio.html already uses: the #0f0c29 ground, the
 * Inter/Playfair pairing, the #a855f7-to-#ec4899 accent, the translucent fixed
 * navbar, the 1100px container. This file exists so those values are written
 * once for the pages that are not the portfolio, not so a second look can grow.
 */

/* ── Reset and base — portfolio.html's, verbatim ───────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #0f0c29;
  color: #e2e8f0;
  line-height: 1.7;
  overflow-x: hidden;
}
::selection { background: #7c3aed; color: #fff; }
a { color: #a855f7; text-decoration: none; transition: color .2s; }
a:hover { color: #c084fc; }
img { max-width: 100%; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* ── Navbar ────────────────────────────────────────────────────────────── */
nav#navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(15,12,41,.85);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(124,58,237,.1);
}
.nav-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 32px;
  display: flex; align-items: center; height: 60px;
}
.nav-brand {
  font-weight: 700; font-size: .95rem; color: #fff;
  display: flex; align-items: center; gap: 10px;
  white-space: nowrap; margin-right: auto; letter-spacing: -.01em;
}
.nav-brand:hover { color: #fff; }
.nav-brand .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: linear-gradient(135deg, #a855f7, #ec4899);
  box-shadow: 0 0 8px rgba(168,85,247,.5);
}
.nav-links { display: flex; gap: 6px; list-style: none; margin: 0 auto; padding: 0; }
.nav-links a {
  color: #7c8ba1; font-size: .76rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: .08em;
  transition: all .25s; padding: 6px 12px; border-radius: 6px;
}
.nav-links a:hover { color: #e2e8f0; background: rgba(255,255,255,.05); }
.nav-links a.active { color: #c084fc; background: rgba(124,58,237,.1); }
.nav-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.lang-toggle {
  position: relative; display: flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px; padding: 5px 10px; cursor: pointer;
  color: #94a3b8; font-size: .72rem; font-weight: 600; letter-spacing: .3px;
}
.lang-toggle:hover { background: rgba(255,255,255,.08); color: #e2e8f0; }
.lang-toggle img { width: 16px; height: 12px; border-radius: 2px; object-fit: cover; }
.lang-toggle i { font-size: .6rem; opacity: .5; }
.lang-dropdown {
  position: absolute; top: calc(100% + 6px); right: 0;
  background: rgba(20,17,50,.96); backdrop-filter: blur(16px);
  border: 1px solid rgba(124,58,237,.2); border-radius: 10px;
  padding: 4px; min-width: 120px; box-shadow: 0 12px 40px rgba(0,0,0,.5);
  opacity: 0; visibility: hidden; transform: translateY(-6px); transition: all .2s;
}
.lang-toggle.open .lang-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.lang-option {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  border-radius: 7px; cursor: pointer; background: none; border: none;
  width: 100%; color: #94a3b8; font-size: .78rem; font-weight: 500;
}
.lang-option:hover { background: rgba(124,58,237,.12); color: #e2e8f0; }
.lang-option.active { color: #c084fc; background: rgba(124,58,237,.15); }
.lang-option img { width: 18px; height: 13px; border-radius: 2px; object-fit: cover; }
.hamburger { display: none; background: none; border: none; color: #e2e8f0; font-size: 1.2rem; cursor: pointer; padding: 8px; }

@media (max-width: 900px) {
  .nav-links {
    display: none; flex-direction: column; gap: 0;
    position: absolute; top: 60px; left: 0; right: 0;
    background: rgba(15,12,41,.97); backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(124,58,237,.15); padding: 8px 0;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 28px; display: block; border-radius: 0; }
  .hamburger { display: block; }
}
@media (max-width: 480px) {
  .nav-brand { font-size: .85rem; }
  .nav-inner { padding: 0 16px; }
}

/* ── Page header ───────────────────────────────────────────────────────── */
.pub-hero { padding: 128px 0 44px; }
.pub-hero h1 {
  font-family: 'Playfair Display', serif; font-size: 2.6rem; line-height: 1.15;
  background: linear-gradient(135deg, #c084fc, #ec4899);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; margin-bottom: .25em;
}
.pub-lede { color: #94a3b8; font-size: 1rem; max-width: 620px; }

/* ── Search and filters ────────────────────────────────────────────────── */
.pub-controls {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  margin: 30px 0 8px;
}
.pub-search {
  flex: 1 1 260px; display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.09);
  border-radius: 12px; padding: 11px 15px;
}
.pub-search i { color: #64748b; font-size: .85rem; }
.pub-search input {
  flex: 1; background: none; border: none; outline: none;
  color: #e2e8f0; font-family: inherit; font-size: .9rem; min-width: 0;
}
.pub-search input::placeholder { color: #64748b; }
.pub-select {
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.09);
  border-radius: 12px; padding: 11px 14px; color: #cbd5e1;
  font-family: inherit; font-size: .85rem; outline: none; cursor: pointer;
}
.pub-select option { background: #17143a; color: #e2e8f0; }
.pub-count { color: #64748b; font-size: .8rem; margin-bottom: 26px; }

/* ── Section headings ──────────────────────────────────────────────────── */
.pub-section-title {
  font-family: 'Playfair Display', serif; font-size: 1.5rem; color: #e2e8f0;
  margin: 38px 0 18px; display: flex; align-items: center; gap: 10px;
}
.pub-section-title i { font-size: .9rem; color: #c084fc; }

/* ── Publication card ──────────────────────────────────────────────────── */
.pub-list { display: flex; flex-direction: column; gap: 16px; }
.pub-card {
  background: rgba(255,255,255,.025);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 16px; padding: 22px 24px; transition: all .25s;
}
.pub-card:hover { border-color: rgba(168,85,247,.3); background: rgba(255,255,255,.04); }
.pub-card.is-featured { border-color: rgba(236,72,153,.28); }
.pub-card-flag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .66rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: #f0abfc; margin-bottom: 10px;
}
/* Authoritative metadata. Never translated — see static/public-i18n.js. */
.pub-title {
  font-size: 1.12rem; font-weight: 700; color: #f1f5f9;
  line-height: 1.4; margin-bottom: 8px; display: block;
}
a.pub-title:hover { color: #c084fc; }
.pub-authors { color: #cbd5e1; font-size: .87rem; line-height: 1.6; }
.pub-source { color: #94a3b8; font-size: .84rem; margin-top: 5px; font-style: italic; }
.pub-meta-row {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 13px; align-items: center;
}
.pub-tag {
  font-size: .68rem; font-weight: 600; letter-spacing: .04em;
  padding: 3px 9px; border-radius: 999px;
  background: rgba(124,58,237,.14); color: #c4b5fd;
  border: 1px solid rgba(124,58,237,.22);
}
.pub-tag.year { background: rgba(148,163,184,.1); color: #cbd5e1; border-color: rgba(148,163,184,.2); }
.pub-doi {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .72rem; color: #64748b; word-break: break-all;
}
.pub-abstract {
  color: #94a3b8; font-size: .87rem; line-height: 1.75; margin-top: 12px;
}

/* ── Actions ───────────────────────────────────────────────────────────── */
.pub-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 16px; }
.pub-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 15px; border-radius: 10px; cursor: pointer;
  font-family: inherit; font-size: .8rem; font-weight: 600;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.04); color: #cbd5e1;
  transition: all .2s; min-height: 40px;
}
.pub-btn:hover { background: rgba(255,255,255,.08); color: #f1f5f9; border-color: rgba(255,255,255,.18); }
.pub-btn.primary {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  border-color: transparent; color: #fff;
}
.pub-btn.primary:hover { filter: brightness(1.1); color: #fff; }
.pub-btn.ghost { background: none; }
.pub-btn i { font-size: .8rem; }
.pub-btn.copied { border-color: rgba(34,197,94,.45); color: #86efac; background: rgba(34,197,94,.1); }

/* ── Cite drawer ───────────────────────────────────────────────────────── */
.cite-backdrop {
  position: fixed; inset: 0; background: rgba(5,4,18,.72);
  backdrop-filter: blur(4px); z-index: 2000; display: none;
}
.cite-backdrop.open { display: block; }
.cite-panel {
  position: fixed; z-index: 2001; right: 0; top: 0; bottom: 0; width: min(560px, 100%);
  background: #14113a; border-left: 1px solid rgba(124,58,237,.25);
  box-shadow: -20px 0 60px rgba(0,0,0,.5);
  display: flex; flex-direction: column; transform: translateX(100%);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
}
.cite-panel.open { transform: none; }
.cite-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px; padding: 22px 24px 16px; border-bottom: 1px solid rgba(255,255,255,.07);
}
.cite-head h2 { font-family: 'Playfair Display', serif; font-size: 1.3rem; color: #f1f5f9; }
.cite-close {
  background: none; border: none; color: #94a3b8; cursor: pointer;
  font-size: 1.1rem; padding: 6px 10px; border-radius: 8px; min-height: 40px;
}
.cite-close:hover { background: rgba(255,255,255,.06); color: #e2e8f0; }
.cite-body { padding: 18px 24px 30px; overflow-y: auto; flex: 1; }
.cite-work {
  font-size: .82rem; color: #94a3b8; line-height: 1.6;
  padding-bottom: 16px; margin-bottom: 6px; border-bottom: 1px solid rgba(255,255,255,.06);
}
.cite-block { margin-top: 20px; }
.cite-label {
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: #a855f7; margin-bottom: 7px;
}
.cite-text {
  background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px; padding: 13px 15px; font-size: .84rem;
  line-height: 1.65; color: #e2e8f0; word-wrap: break-word; overflow-wrap: anywhere;
}
.cite-text i, .cite-text em { color: #f1f5f9; }
.cite-row { display: flex; gap: 9px; margin-top: 9px; flex-wrap: wrap; }
.cite-code {
  background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px; padding: 13px 15px; font-size: .74rem; line-height: 1.6;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #cbd5e1; overflow-x: auto; white-space: pre; max-height: 300px;
}
.cite-error {
  font-size: .8rem; color: #fca5a5; background: rgba(239,68,68,.08);
  border: 1px solid rgba(239,68,68,.2); border-radius: 10px; padding: 11px 14px;
}

/* ── Detail page ───────────────────────────────────────────────────────── */
.pub-detail { padding: 118px 0 60px; }
.pub-back { font-size: .8rem; color: #94a3b8; display: inline-flex; align-items: center; gap: 7px; }
.pub-detail h1 {
  font-family: 'Playfair Display', serif; font-size: 2rem; color: #f1f5f9;
  line-height: 1.28; margin: 16px 0 14px;
}
.pub-detail-authors { color: #cbd5e1; font-size: .95rem; line-height: 1.7; }
.pub-detail-source { color: #94a3b8; font-size: .9rem; margin-top: 8px; font-style: italic; }
.pub-panel {
  background: rgba(255,255,255,.025); border: 1px solid rgba(255,255,255,.07);
  border-radius: 16px; padding: 22px 24px; margin-top: 22px;
}
.pub-panel h2 {
  font-size: .95rem; color: #e2e8f0; margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.pub-dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px 22px; }
.pub-dl dt {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .08em;
  color: #64748b; font-weight: 700; margin-bottom: 3px;
}
.pub-dl dd { font-size: .87rem; color: #cbd5e1; word-break: break-word; }

.pub-empty { text-align: center; padding: 64px 20px; color: #64748b; }
.pub-empty i { font-size: 2rem; opacity: .35; display: block; margin-bottom: 14px; }

.pub-footer {
  border-top: 1px solid rgba(255,255,255,.06); margin-top: 70px;
  padding: 30px 0 40px; color: #64748b; font-size: .8rem; text-align: center;
}
.pub-footer-note { font-size: .74rem; margin-top: 5px; color: #475569; }

/* ── Mobile ────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .pub-hero { padding: 100px 0 30px; }
  .pub-hero h1 { font-size: 1.9rem; }
  .pub-detail h1 { font-size: 1.5rem; }
  .pub-card { padding: 18px 16px; border-radius: 14px; }
  /* Thumb-sized copy targets, and each action on its own full-width row so a
     mis-tap opens nothing rather than the wrong thing. */
  .pub-actions { gap: 8px; }
  .pub-actions .pub-btn { flex: 1 1 100%; justify-content: center; min-height: 46px; }
  .cite-panel { top: auto; height: 92vh; width: 100%; border-left: none;
                border-top: 1px solid rgba(124,58,237,.25);
                border-radius: 18px 18px 0 0; transform: translateY(100%); }
  .cite-panel.open { transform: none; }
  .cite-row .pub-btn { flex: 1 1 100%; justify-content: center; }
  .cite-code { font-size: .68rem; }
}

@media (prefers-reduced-motion: reduce) {
  .cite-panel { transition: none; }
  * { scroll-behavior: auto; }
}
