/* =========================================================
   jianzou.me — site layer
   Design system: quiet warm-white paper, sumi ink,
   kaki (柿) accent. Source Serif 4 for the voice, Inter for
   UI metadata, mono for tags and labels. Hairlines only
   where they earn their keep.
   ========================================================= */

/* Slightly whiter paper than the raw token, to calm the warmth. */
:root {
  --paper:       #FAF8F3;
  --paper-2:     #F3EFE7;
  --paper-3:     #EAE4D7;
  --rule-soft:   #CFC7B6;
  --rule-faint:  #E6E0D1;
}

/* --- reset rmarkdown/bootstrap residue -------------------------------- */
body { background: var(--paper); color: var(--ink); }
.main-container, .container-fluid, .container { max-width: none; padding: 0; margin: 0; }
.title, h1.title { display: none; }
#header { display: none; }
.navbar { display: none; }

/* --- global link rule: ink default, kaki on hover, no underline ------ */
a, a:visited {
  color: var(--ink);
  text-decoration: none;
  border: 0;
  padding: 0;
  transition: color var(--dur-1) var(--ease);
}
a:hover { color: var(--kaki); }

.site-main a,
.site-main a:visited { color: var(--ink); }
.site-main a:hover { color: var(--kaki); }

/* =========================================================
   Site shell — narrower for a centered reading feel
   ========================================================= */
.site-shell {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 var(--s-5);
  position: relative;
}

/* --- top nav: one hairline, compact metadata ------------------------- */
.site-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--s-5) 0 var(--s-3);
  border-bottom: 1px solid var(--ink);
}
.site-nav .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  border: 0;
}
.site-nav .brand img { width: 32px; height: auto; display: block; }
.site-nav .brand .name {
  font-family: var(--ff-serif);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.005em;
  line-height: 1;
  color: var(--ink);
}
.site-nav ul.nav-main {
  list-style: none; padding: 0; margin: 0;
  display: flex; gap: var(--s-5); align-items: center;
}
.site-nav ul.nav-main a {
  font-family: var(--ff-sans);
  font-size: 13px;
  color: var(--ink-2);
  letter-spacing: 0.02em;
  border: 0;
}
.site-nav ul.nav-main a:hover { color: var(--kaki); }
.site-nav ul.nav-main a.active { color: var(--ink); }
.site-nav .nav-icons {
  display: flex; gap: var(--s-4); align-items: center;
}
.site-nav .nav-icons a {
  color: var(--ink-3);
  font-size: 14px;
  border: 0; line-height: 1;
}
.site-nav .nav-icons a:hover { color: var(--kaki); }

/* =========================================================
   Main content — typography
   ========================================================= */
.site-main { padding: var(--s-5) 0 var(--s-7); }

.site-main p {
  font-family: var(--ff-serif);
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
  margin: 0 0 var(--s-3);
}
.site-main h1 {
  font-family: var(--ff-serif);
  font-weight: 400;
  font-size: clamp(28px, 2.6vw, 32px);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: var(--s-5) 0 var(--s-3);
  color: var(--ink);
}
.site-main h2 {
  font-family: var(--ff-serif);
  font-weight: 400;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.005em;
  margin: var(--s-6) 0 var(--s-3);
  color: var(--ink);
}
.site-main h3 {
  font-family: var(--ff-sans);
  font-weight: 500;
  font-size: 16px;
  margin: var(--s-4) 0 var(--s-1);
  color: var(--ink);
}
.site-main h4 {
  font-family: var(--ff-sans);
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: var(--s-4) 0 var(--s-2);
}
.site-main em { font-style: italic; }
.site-main strong { font-weight: 600; color: var(--ink); }
.site-main code {
  font-family: var(--ff-mono);
  font-size: 13px;
  background: var(--paper-2);
  padding: 1px 5px;
  border-radius: var(--r-1);
  color: var(--ink);
}

/* unordered lists — small dots, not dashes */
.site-main ul {
  padding: 0; margin: 0 0 var(--s-4);
  list-style: none;
}
.site-main ul > li {
  font-family: var(--ff-serif);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  padding: 4px 0 4px 22px;
  position: relative;
}
.site-main ul > li::before {
  content: "";
  position: absolute;
  left: 6px; top: 15px;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--ink-3);
}
.site-main ul ul > li { padding: 2px 0 2px 22px; }
.site-main ul ul > li::before {
  top: 13px;
  width: 3px; height: 3px;
}

.site-main hr {
  border: 0; height: 1px;
  background: var(--rule-soft);
  margin: var(--s-5) 0;
}

/* =========================================================
   Redundant page-head — suppressed globally
   (the nav already names the page)
   ========================================================= */
.page-head { display: none; }

/* =========================================================
   Index hero — two column: voice + "Recent" side panel
   ========================================================= */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: var(--s-6);
  padding: var(--s-5) 0 var(--s-5);
  align-items: start;
}
.hero .eyebrow {
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: var(--s-3);
}
.hero h1.display {
  font-family: var(--ff-serif);
  font-weight: 400;
  font-size: clamp(26px, 2.4vw, 32px);
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 0 0 var(--s-3);
  color: var(--ink);
  max-width: 30ch;
}
.hero h1.display em {
  font-style: italic;
  color: var(--kaki);
  font-weight: 400;
}
.hero .hero-body p {
  font-family: var(--ff-serif);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  margin: 0 0 var(--s-3);
}
.hero .hero-body p.lede {
  font-size: 17px;
  color: var(--ink);
}
.hero .hero-body p em {
  font-style: italic;
  color: var(--kaki-ink);
}

/* --- right-side "Recent" panel --- */
.hero .side {
  border-left: 1px solid var(--rule-soft);
  padding-left: var(--s-4);
  font-family: var(--ff-sans);
  font-size: 13px;
  color: var(--ink-2);
}
.hero .side .side-label {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 12px;
}
.hero .side .side-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--rule-faint);
}
.hero .side .side-item:last-child { border-bottom: 0; }
.hero .side .side-item b {
  display: block;
  color: var(--ink);
  font-weight: 500;
  font-family: var(--ff-serif);
  font-size: 14px;
  line-height: 1.35;
}
.hero .side .side-item i {
  font-style: italic;
  color: var(--ink-3);
  font-family: var(--ff-serif);
  font-size: 12px;
  display: block;
  margin-top: 3px;
}
.hero .side a { color: var(--ink); }
.hero .side a:hover { color: var(--kaki); }

/* =========================================================
   Research — bridge prose + three research-interest blocks
   Two-column areas: narrow mono tag on the left, content on the right.
   ========================================================= */
.area {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: var(--s-5);
  padding: var(--s-5) 0;
  border-top: 1px solid var(--rule-soft);
  align-items: start;
}
.area:first-of-type { border-top: 0; padding-top: var(--s-3); }

.area .area-meta { display: block; }
.area .area-meta .tag-col {
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  line-height: 1.5;
  position: sticky;
  top: var(--s-4);
}
.area h3.area-title {
  font-family: var(--ff-serif);
  font-weight: 400;
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 0 0 var(--s-1);
  color: var(--ink);
}
.area .area-refs {
  font-family: var(--ff-sans);
  font-style: italic;
  font-size: 12px;
  color: var(--ink-4);
  margin-bottom: var(--s-2);
}
.area p { margin: 0 0 var(--s-3); }
.area strong { color: var(--kaki-ink); font-weight: 600; }

/* =========================================================
   Publication / presentation rows
   ========================================================= */
.pub-intro {
  font-family: var(--ff-sans);
  font-size: 13px;
  color: var(--ink-3);
  margin: 0 0 var(--s-3);
}
.pub-intro a { color: var(--ink); }
.pub-intro a:hover { color: var(--kaki); }

.section-label {
  font-family: var(--ff-sans);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: var(--s-5) 0 var(--s-1);
  font-weight: 500;
}
.section-label:first-of-type { margin-top: var(--s-3); }

.pub-list { margin: 0 0 var(--s-5); }

.pub {
  display: grid;
  grid-template-columns: 36px 1fr 54px;
  gap: var(--s-3);
  padding: var(--s-3) 0;
  align-items: baseline;
}
.pub + .pub { border-top: 1px solid var(--rule-faint); }
.pub .pub-num {
  font-family: var(--ff-mono);
  font-size: 12px;
  color: var(--ink-4);
  letter-spacing: 0.02em;
}
.pub .pub-title {
  font-family: var(--ff-serif);
  font-size: 16px;
  line-height: 1.4;
  color: var(--ink);
}
.pub .pub-title a { color: var(--ink); border: 0; }
.pub .pub-title a:hover { color: var(--kaki); }
.pub .pub-authors {
  font-family: var(--ff-sans);
  font-size: 12.5px;
  color: var(--ink-3);
  margin-top: 5px;
  line-height: 1.5;
}
.pub .pub-authors b { color: var(--ink); font-weight: 600; }
/* Advisee: single straight underline, no color shift */
.pub .pub-authors u {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  text-decoration-color: var(--ink-3);
}
.pub .pub-venue {
  font-family: var(--ff-serif);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-2);
  margin-top: 4px;
}
.pub .pub-venue-extra {
  font-family: var(--ff-sans);
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 3px;
}
.pub .pub-venue-extra a { color: var(--ink); }
.pub .pub-venue-extra a:hover { color: var(--kaki); }
.pub .pub-year {
  font-family: var(--ff-mono);
  font-size: 12px;
  color: var(--ink-4);
  text-align: right;
  letter-spacing: 0.04em;
}
.pub[hidden], .pub.is-hidden { display: none; }

/* =========================================================
   Filter — publications only, tag buttons only.
   No frame, no "Filters" label, no search box, no year.
   On presentations the whole .filters block is stripped
   from markup, so nothing renders there.
   ========================================================= */
.filters {
  padding: 0;
  border: 0;
  background: transparent;
  margin: var(--s-3) 0 var(--s-4);
}
.filters::before { content: none; }
.filters .filter-row,
.filters .filter-count { display: none; }

.filter-tabs {
  display: flex;
  gap: var(--s-2);
  flex-wrap: wrap;
  padding: 0;
  border: 0;
}
.filter-tabs .tab {
  font-family: var(--ff-sans);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  background: transparent;
  border: 1px solid var(--rule-soft);
  border-radius: var(--r-full);
  padding: 5px 14px;
  cursor: pointer;
  font-weight: 500;
  transition: all var(--dur-1) var(--ease);
}
.filter-tabs .tab:hover { color: var(--ink); border-color: var(--ink-3); }
.filter-tabs .tab.is-active {
  color: var(--paper);
  background: var(--ink);
  border-color: var(--ink);
}
.filter-tabs .tab[data-section="featured"].is-active {
  background: var(--kaki);
  border-color: var(--kaki);
}
.filter-tabs .tab[data-section="major"].is-active {
  background: var(--kon);
  border-color: var(--kon);
}

/* =========================================================
   Footer — one line, cat mark centered. Shown on every page
   except the index (the index has .hero in .site-main).
   ========================================================= */
.site-horizon { display: none; }
.site-foot {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: var(--s-6) 0 var(--s-5);
}
.site-foot img {
  width: 38px;
  height: auto;
  opacity: 1;
  display: block;
}
.site-foot .colophon, .site-foot .meta { display: none; }

/* Hide the footer specifically on pages that contain a .hero block (index). */
body:has(.site-main .hero) .site-foot { display: none; }

/* =========================================================
   Tocify (teaching sidebar) — hidden; content column fills
   ========================================================= */
#TOC, .tocify, .tocify-header, .tocify-subheader { display: none !important; }
.toc-content {
  width: 100% !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  float: none !important;
}
.row > [class*="col-"]:has(#TOC) { display: none !important; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 820px) {
  .site-nav { flex-wrap: wrap; gap: var(--s-3); }
  .site-nav ul.nav-main { gap: var(--s-3); flex-wrap: wrap; }
  .hero { grid-template-columns: 1fr; gap: var(--s-5); }
  .hero .side {
    border-left: 0;
    border-top: 1px solid var(--rule-soft);
    padding-left: 0;
    padding-top: var(--s-4);
  }
  .area { grid-template-columns: 1fr; gap: var(--s-2); }
  .area .area-meta .tag-col { position: static; }
  .pub { grid-template-columns: 28px 1fr 48px; gap: var(--s-2); }
}
