:root{
  --ink:#1c1c1c;
  --muted:#666;
  --line:#e8e8e8;
  --accent:#2c5aa0;
  --soft:#f7f8fb;

  /* Typography */
  --serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;

  /* Layout rhythm */
  --content: 72ch;        /* line length sweet spot */
  --radius: 14px;
}

html,body{margin:0;padding:0}
html{scroll-behavior:smooth}
body{
  color:var(--ink);
  background:var(--soft);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  font-kerning: normal;
}

/* Centered, readable page width */
.wrap{
  max-width: calc(var(--content) + 56px);
  margin: 44px auto;
  background: white;
  border-radius: var(--radius);
  padding: 42px 40px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.06);
  border: 1px solid rgba(0,0,0,0.04);
}

@media (max-width: 860px){
  .wrap{
    margin: 20px auto;
    padding: 28px 20px;
    border-radius: 12px;
  }
}

/* Navigation */
nav{
  display:flex;
  gap: 10px;
  flex-wrap:wrap;
  margin: 0 0 28px 0;
  font-family: var(--sans);
  font-size: 0.95rem;
}

nav a{
  text-decoration: none;
  border: 0;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--muted);
}

nav a:hover{
  background: #eef2fb;
  color: var(--accent);
}

/* Hugo usually sets .active or aria-current depending on theme.
   Keep both for safety. */
nav a.active,
nav a[aria-current="page"]{
  background: rgba(44,90,160,0.10);
  color: var(--accent);
}

/* Headings */
header{margin: 8px 0 28px 0}

h1,h2,h3{
  color: #121212;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 0;
}

h1{
  font-size: clamp(2.1rem, 3.2vw, 2.7rem);
  margin: 0 0 10px 0;
}

h2{
  margin: 1.8rem 0 0.8rem 0;
  font-size: 1.35rem;
  border-left: none;
  padding-left: 0;
  position: relative;
}

h2::after{
  content:"";
  display:block;
  margin-top: 10px;
  width: 54px;
  height: 3px;
  border-radius: 999px;
  background: var(--accent);
  opacity: 0.85;
}

h3{
  margin: 1.4rem 0 0.45rem 0;
  font-size: 1.08rem;
  font-family: var(--sans);
  letter-spacing: -0.01em;
}

/* Body text rhythm */
p{margin: 0.75rem 0}
.meta{
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.98rem;
}

/* Links: more “book-like” */
a{
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(44,90,160,0.25);
}

a:hover{
  border-bottom-color: var(--accent);
}

/* Lists */
ul,ol{margin: 0.8rem 0 1rem 1.2rem}
li{margin: 0.25rem 0}

/* Horizontal rule */
hr{
  border:0;
  border-top:1px solid var(--line);
  margin: 28px 0;
}

/* Footer */
.footer{
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.95rem;
}

/* Notes */
.note{
  color:#777;
  font-style: italic;
  font-size: 0.95em;
}

/* Bio layout */
.bio{
  display:grid;
  grid-template-columns: 1fr 190px;
  gap: 26px;
  align-items:start;
}

.bio img{
  width:100%;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 10px 20px rgba(0,0,0,0.06);
}

@media (max-width: 860px){
  .bio{grid-template-columns:1fr;}
}

/* CV tables */
.cv table{
  width:100%;
  border-collapse:collapse;
  margin: 0.9rem 0 1.6rem 0;
  font-family: var(--sans);
  font-size: 0.98rem;
}

.cv tr{
  border-top: 1px solid rgba(0,0,0,0.04);
}

.cv tr:first-child{
  border-top: 0;
}

.cv td{
  padding: 9px 12px;
  vertical-align: top;
}

.cv td:first-child{
  text-align: right;
  white-space: nowrap;
  color: #555;
  width: 160px;
  padding-right: 28px;
}

/* Inline code */
code{
  font-family: var(--mono);
  font-size: 0.95em;
  background: rgba(0,0,0,0.04);
  padding: 0.12em 0.35em;
  border-radius: 6px;
}

.pub{ margin: 0.9rem 0; padding-left: 1rem; border-left: 3px solid rgba(44,90,160,0.18); }
.pub-title{ font-family: var(--sans); font-weight: 600; line-height: 1.35; }
.pub-authors{ color: var(--muted); margin-top: 0.15rem; }
.pub-venue{ margin-top: 0.15rem; }
.pub-note{ color: var(--muted); font-family: var(--sans); font-size: 0.95rem; margin: 0.4rem 0 1rem 0; }
.pub-list{
  margin: 0.8rem 0 1.6rem 1.4rem;
}
.pub-list li{
  margin: 0.6rem 0;
}
.pub-list li::marker{
  font-weight: 600;
  color: var(--muted);
}

