/* =========================================================
   COMMON SITE STYLES
   Shared by index.html, publications.html, and projects.html.
   Change colors, typography, header/nav, buttons, page titles,
   cards, footer, and fade transitions here once for all pages.
   ========================================================= */

:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --soft: #f0f2f8;
  --text: #1b1f2a;
  --muted: #4b5569;
  --brand: #2f6dff;
  --brand-strong: #1e56e6;
  --accent: var(--brand);
  --radius: 16px;
  --shadow: 0 8px 24px rgba(31,35,45,0.08), 0 2px 6px rgba(31,35,45,0.06);
  --hero-bg: #e9edf6;
}

html.dark-init,
body.dark-mode {
  --bg: #0b0c0f;
  --card: #111318;
  --soft: #171a21;
  --text: #e7e9ee;
  --muted: #a5adbd;
  --brand: #6aa7ff;
  --brand-strong: #4c89ff;
  --accent: #528ee6;
  --shadow: 0 8px 24px rgba(0,0,0,0.35), 0 2px 6px rgba(0,0,0,0.2);
  --hero-bg: #0f1218;
}

html.dark-init .nav-logo-img,
body.dark-mode .nav-logo-img {
  content: url("../logos/Logo_2_trans.png");
}

html {
  scroll-behavior: smooth;
  overflow-y: scroll;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  opacity: 0;
  transition: opacity 0.4s ease-in-out;
}

body.fade-in {
  opacity: 1;
}

a {
  color: var(--brand);
  text-decoration: none;
}

body.dark-mode a {
  color: var(--text);
}

a:hover {
  text-decoration: underline;
}

.container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 24px;
}

.muted {
  color: var(--muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.2s, border-color 0.2s, background 0.2s;
}

.btn:hover {
  transform: translateY(-2px);
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
}

.btn-primary:hover {
  background: var(--brand-strong);
  border-color: var(--brand-strong);
}

.btn-soft {
  background: var(--soft);
  color: var(--text);
  border: 1px solid var(--soft);
}

.btn-soft:hover {
  border-color: var(--brand);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--card);
  border-bottom: 1px solid var(--soft);
}

.nav {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo {
  display: flex;
  align-items: center;
  min-width: 150px;
}

.nav-logo-img {
  height: 55px;
  width: 55px;
  border-radius: 8px;
  transition: transform 0.2s ease;
}

.nav-logo-img:hover {
  transform: scale(1.05);
}

.nav-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  gap: 18px;
  white-space: nowrap;
}

.nav-center a {
  color: var(--text);
  font-weight: 500;
  opacity: 0.85;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.nav-center i {
  width: 1.25em;
  text-align: center;
}

.nav-center a:hover,
.nav-center a.active {
  opacity: 1;
  color: var(--brand-strong);
  text-decoration: none;
}

.btn-toggle {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--soft);
  background: var(--soft);
  cursor: pointer;
  color: var(--text);
  margin-left: auto;
  z-index: 50;
}

.btn-toggle:hover {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.page-head {
  margin-top: 26px;
}

.title-card,
.card {
  background: var(--card);
  border: 1px solid var(--soft);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.page-title {
  margin: 0;
  font-size: clamp(22px, 2.2vw + 10px, 34px);
}

.page-sub {
  margin: 6px 0 0;
  color: var(--muted);
}

section {
  margin-top: 26px;
}

.section-title {
  margin: 0 0 14px;
  font-size: 18px;
}

footer.site-footer {
  margin-top: 60px;
  padding: 24px 0;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  border-top: 1px solid var(--soft);
  background: var(--bg);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 800px) {
  .nav-center {
    flex-wrap: wrap;
  }
}
