/* ---------- Fonts ---------- */
@font-face{
  font-family: "Fira Code";
  src: url("fonts/FiraCode-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face{
  font-family: "Fira Code";
  src: url("fonts/FiraCode-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face{
  font-family: "Fira Code";
  src: url("fonts/FiraCode-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* ---------- Design tokens ---------- */
:root{
  /* Colors */
  --bg: #0b0f14;
  --panel: #0f1620;
  --text: #d6deeb;
  --muted: #8aa0b5;
  --line: rgba(255,255,255,.08);
  --accent: #7dd3fc;

  /* Typography */
  --font-mono: "Fira Code", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --lh: 1.55;
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";

  /* Layout + sizing (rem-based so it scales with font-size) */
  --wrap: 62rem;
  --gutter: 1.25rem;

  --radius: 0.75rem;
  --radius-sm: 0.625rem;
  --border: 0.0625rem;

  --icon: 1.125rem;
  --hero-img: 10rem;
}

/* ---------- Base font scaling (stable on mobile) ---------- */
html{ font-size: 100%; } /* respects user default */
@media (min-width: 30rem){ html{ font-size: 106.25%; } }  /* ~17px */
@media (min-width: 48rem){ html{ font-size: 112.5%; } }   /* ~18px */
@media (min-width: 80rem){ html{ font-size: 118.75%; } }  /* ~19px */

/* ---------- Resets ---------- */
*{ box-sizing: border-box; }
html,body{ height: 100%; }
body{
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  line-height: var(--lh);
}
img{ max-width: 100%; height: auto; display: block; }

/* ---------- Global link style (marker hover everywhere) ---------- */
a{
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 0.125rem;
  text-underline-offset: 0.2em;

  padding: 0 .15em;
  margin: 0 -.15em;

  transition: background-color .12s ease, color .12s ease, text-decoration-color .12s ease;
}
a:hover{
  background: var(--accent);
  color: var(--bg);
  text-decoration-color: transparent;
}

/* Opt-out: back link only */
.back{
  padding: 0;
  margin: 0;
  text-decoration: none;
  color: var(--muted);
}
.back:hover{
  background: transparent;
  color: var(--text);
  text-decoration-color: var(--accent);
}

/* ---------- Layout ---------- */
.wrap{
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 2rem var(--gutter) 5rem;
}
.section{ margin-top: 2.25rem; }

/* ---------- Typography ---------- */
.h1{
  font-size: 2rem;
  margin: 0 0 0.75rem;
  font-weight: 600;
}
.h2{
  font-size: 1.5rem;
  margin: 1.75rem 0 1rem;
  font-weight: 600;
}
.year{
  margin: 1.5rem 0 0.75rem;
  font-size: 1.5rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .12em;
}
.prose{ max-width: 72ch; }
.muted{ color: var(--muted); }

.accent-dot{
  color: var(--accent);
}

/* ---------- Header ---------- */
.header{
  position: sticky;
  top: 0;
  z-index: 10;

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 0.875rem var(--gutter);

  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  border-bottom: var(--border) solid var(--line);
}

.header__left{ display: flex; align-items: center; gap: 1rem; }
.brand{ color: var(--text); font-weight: 600; letter-spacing: .02em; }

.icons{ display: flex; gap: 0.625rem; }
.icon{
  width: var(--icon);
  height: var(--icon);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: .9;
}
.icon svg{ width: var(--icon); height: var(--icon); fill: var(--muted); }

/* Make icon hover invert nicely with global <a:hover> */
.icon:hover svg{ fill: var(--bg); }


/* Nav */
.header__right{ display: flex; gap: 1rem; }
.navlink{
  color: var(--muted);
  text-decoration: underline;
  text-decoration-color: var(--accent);
}
.navlink:hover{
  color: var(--bg);
}

/* ---------- Hero (about + image) ---------- */
.hero{
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--hero-img);
  gap: 1.25rem;
  align-items: start;
}
.hero__img{ justify-self: end; }
.hero__img img{
  width: var(--hero-img);
  height: var(--hero-img);
  max-width: var(--hero-img);
  border-radius: var(--radius);
  object-fit: cover;
  border: var(--border) solid var(--line);
  background: var(--panel);
  margin-top: 0.75em;
}

/* ---------- Publications list ---------- */
.pubs{
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.pub{
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 0.875rem;

  padding: 0.875rem;
  background: var(--panel);
  border: var(--border) solid var(--line);
  border-radius: var(--radius-sm);
}

.pub__meta{
  display: flex;
  flex-direction: column;
  gap: 0.375rem;

  color: var(--muted);
  font-size: 0.875rem;
}

.pub__main .title{
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.pub__main .authors{
  color: var(--muted);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.pub__bottom{
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}

.pub__bottom .venue{
  color: var(--muted);
  font-size: 0.875rem;
}

.pub__bottom .links{
  margin-left: auto;
}

.links{
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  font-size: 0.875rem;
}

.author-me{
  color: var(--accent);
  font-weight: 600;
}


/* ---------- Detail page ---------- */
.pubdetail-meta{ margin: 0.5rem 0 1.25rem; }
.detail-links{
  display: flex;
  gap: 0.625rem;
  flex-wrap: wrap;
  margin: 0.75rem 0 1.5rem;
}



.abstract-box{
  background: var(--panel);
  border: var(--border) solid var(--line);
  border-radius: var(--radius-sm);

  padding: 1rem 2rem; /* top/bottom, left/right */

  margin-top: 0.25rem;

  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
  text-align-last: left;
}

/* Buttons (often anchors) should not get marker padding/margins */
.btn{
  display: inline-block;
  border: var(--border) solid var(--line);
  background: transparent;
  color: var(--text);
  padding: 0.5rem 0.625rem;
  margin: 0;          /* override global link margin */
  border-radius: var(--radius-sm);
  font-family: inherit;
  cursor: pointer;
  text-decoration: none; /* override global underline */
}
.btn:hover{
  background: transparent; /* override marker background */
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  text-decoration: none;
}

.cite{
  border: var(--border) solid var(--line);
  background: var(--panel);
  border-radius: var(--radius-sm);
  padding: 0.875rem;
  overflow: auto;
  font-size: 0.875rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 45rem){
  .pub{ grid-template-columns: 1fr; }
  .hero{ grid-template-columns: 1fr; }
  .hero__img{ 
    justify-self: start; 
    margin-top: 0em;
}

  .header{
    flex-wrap: wrap;
    row-gap: 0.75rem;
  }
  .header__right{
    width: 100%;
    justify-content: flex-end;
  }

  /* Optional: less jank on some phones */
  .header{
    backdrop-filter: none;
    background: var(--bg);
  }
}

