/* ============================
   Global variables (single theme only)
   ============================ */

:root{
  --bg: #f7f7f7;        /* page background (off-white) */
  --panel: #ffffff;     /* main content panel */

  --text: #111111;
  --muted: #555555;
  --line: #e6e6e6;
  --link: #0b63ce;

  --chip-bg: #ffffff;
  --chip-hover: #f1f1f1;

  --max: 980px;
}

/* ============================
   Base
   ============================ */

*{ box-sizing: border-box; }

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

.wrap{
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
}

a{ color: var(--link); }
a:hover{ text-decoration: underline; }

h1, h2, h3{
  line-height: 1.25;
  margin: 0 0 10px;
}
h2{ font-size: 1.35rem; }
h3{ font-size: 1.1rem; }

p{ margin: 10px 0; }
ul, ol{ padding-left: 18px; }

/* ============================
   Main content “card”
   ============================ */

main.wrap{
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 18px;
  margin: 18px auto;
}

@media (max-width: 780px){
  main.wrap{
    padding: 0 12px;
    margin: 12px auto;
  }
}

/* ============================
   Navigation
   ============================ */

.topbar{
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-inner{
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 0;
  align-items: center;
}

.brand{
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
}

.nav{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.nav a{
  padding: 8px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
}

.nav a:hover{
  background: rgba(0,0,0,0.06);
  text-decoration: none;
}

.nav a.active{
  background: rgba(0,0,0,0.08);
  font-weight: 600;
}

/* ============================
   Sections
   ============================ */

.section{
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.footer{
  padding: 18px 0 30px;
  color: var(--muted);
}

/* ============================
   Figures
   ============================ */

.figure{
  margin: 12px 0 6px;
}

.figure img{
  width: 100%;
  max-width: 480px;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: block;
}

.figure.big{
  text-align: center;
}

.figure.big img{
  margin: 0 auto;
  max-width: 740px;
}

/* Bracket legends under figures */
.legend{
  margin: 4px 0 14px;
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
}

/* ============================
   Research intro: text left, thesis cover right
   ============================ */

.research-intro{
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 24px;
  align-items: start;
  margin-top: 12px;
}

.research-intro .intro-figure{
  justify-self: end;
}

.thesis-cover{
  width: 100%;
  max-width: 240px;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: block;
}

/* ============================
   Disqus
   ============================ */

#disqus_thread{
  margin-top: 12px;
}

/* ============================
   Mobile
   ============================ */

@media (max-width: 780px){
  .research-intro{
    grid-template-columns: 1fr;
  }

  .research-intro .intro-figure{
    justify-self: start;
  }

  .thesis-cover{
    max-width: 65%;
  }

  .figure img,
  .figure.big img{
    max-width: 100%;
  }
}
