:root{
  --page-bg: #2c2f33;
  --card-bg: #8ea3b3;
  --text: #0b1220;
  --muted: rgba(11,18,32,.78);

  --tab-bg: #3b4046;
  --tab-active: #d18b00;
  --tab-text: #f3f4f6;

  --border: rgba(0,0,0,.22);
  --radius: 18px;

  --maxw: 980px;
}

*{ box-sizing: border-box; }

body{
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial;
  background: var(--page-bg);
  color: var(--text);
  line-height: 1.5;
}

.wrap{
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px 16px 28px;
}

/* Header */
.header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.brand{
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: .2px;
  color: #fff;
  line-height: 1.1;
  white-space: nowrap;
}

/* Tabs */
.tabs{
  display: flex;
  gap: 10px;
  align-items: center;
}

.tab{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--tab-bg);
  color: var(--tab-text);
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  border: 1px solid rgba(255,255,255,.12);
  user-select: none;
}
.tab:hover{ filter: brightness(1.06); }
.tab.active{
  background: var(--tab-active);
  border-color: rgba(0,0,0,.15);
  color: #1a1a1a;
}

/* Mobile menu */
.menu-btn{
  display: none;
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(0,0,0,.18);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

/* Hide mobile nav by default (prevents duplication) */
.mobile-nav{ display: none; }

/* Card */
.card{
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 18px 50px rgba(0,0,0,.25);
  border: 1px solid var(--border);
}

.card-inner{
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
  align-items: start;
}

.photo{
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,.18);
  background: rgba(255,255,255,.25);
}

.photo img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(12%);
}

h2{
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 800;
}

p{ margin: 0 0 12px; }
p.muted{ color: var(--muted); }

a{ color: #0b2b7a; font-weight: 700; }
a:hover{ text-decoration: underline; }

.footer{
  margin-top: 10px;
  text-align: center;
  color: rgba(255,255,255,.55);
  font-size: 12px;
  font-style: italic;
}

/* Simple stub list styling */
.stub-list{
  margin: 10px 0 0;
  padding-left: 18px;
}
.stub-list li{ margin: 8px 0; }

/* Responsive */
@media (max-width: 720px){
  .brand{ font-size: 24px; }
  .tabs{ display: none; }
  .menu-btn{ display: inline-flex; align-items: center; }

  .card-inner{ grid-template-columns: 1fr; }
  .photo{ max-width: 260px; margin: 0 auto; }

  .mobile-nav{
    display: none;
    margin-top: 10px;
    gap: 10px;
    flex-wrap: wrap;
  }
  .mobile-nav.open{ display: flex; }
}

/* --- Mobile fix for publications tables (prevents overflow) --- */
.card { overflow: hidden; }            /* keep content inside rounded card */

table { max-width: 100%; }             /* never exceed container width */
td, th { max-width: 100%; }            /* allow cells to shrink */

td, th, strong, a, p {
  overflow-wrap: anywhere;             /* break long strings if needed */
  word-break: break-word;
}

/* Publications: stack thumbnail above text on narrow screens */
@media (max-width: 900px){
  table, tbody, tr, td { display: block; width: 100%; }
  tr { margin-bottom: 18px; }
  td { padding: 8px 0; }

  /* make thumbnail scale nicely */
  td img { max-width: 100%; height: auto; display: block; }
}

.pub-links{
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;              /* allows wrap cleanly if needed */
}

.pub-link{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;          /* keeps icon+label together */
}

.pub-link img{
  width: 16px;
  height: 16px;
  display: inline-block;
}

.pub-sep{
  opacity: .7;
}

/* If the screen is very narrow, hide the separator instead of awkward wrapping */
@media (max-width: 420px){
  .pub-sep{ display:none; }
}