/* ==========================================================================
   SCIENCEFOLIO — site.css
   Structure and components. Everything reads from tokens.css — you should
   rarely need to touch this file.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  text-wrap: pretty;
}
main { flex: 1; }
a { color: var(--ink); text-underline-offset: 4px; text-decoration-thickness: 2px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--ink); color: var(--paper); }
img { max-width: 100%; display: block; }

/* ---- nav ---------------------------------------------------------------- */
.nav {
  border-bottom: var(--rule);
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px 30px;
  padding: 16px var(--edge);
  font-size: 14px;
  font-weight: 600;
}
.nav a { text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--accent); }
.nav a.nav-name {
  flex-basis: 100%;
  text-align: center;
  border-bottom: 0;
  padding: 0;
  font-family: var(--font-display);
  font-weight: var(--head-weight);
  font-size: 17px;
  letter-spacing: var(--head-tracking);
}
.nav a.nav-name:hover { color: var(--accent); }

/* ---- hero --------------------------------------------------------------- */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: clamp(48px, 9vh, 96px) var(--edge) clamp(56px, 10vh, 104px);
}
.portrait { width: 152px; height: 152px; margin: 0; border: var(--rule); }
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.hero h1 {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: clamp(40px, 6vw, 84px);
  line-height: var(--display-leading);
  letter-spacing: var(--display-tracking);
  margin: 28px 0 0;
}
.kicker {
  font-family: var(--font-label);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 14px 0 0;
}
.short-rule { width: 72px; border: 0; border-top: 2px solid var(--accent); margin: 28px auto; }
.statement {
  font-family: var(--font-statement);
  font-weight: 300;
  font-size: clamp(19px, 2vw, 26px);
  line-height: 1.4;
  max-width: 36ch;
  margin: 0;
}
.statement strong { font-weight: var(--emph-weight); font-style: var(--emph-style); color: var(--accent); }
.profile-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  font-family: var(--font-label);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: var(--label-tracking);
  text-transform: var(--label-transform);
}

/* ---- page head (inner pages) -------------------------------------------- */
.page-head { text-align: center; padding: clamp(48px, 8vh, 88px) var(--edge) 12px; }
.page-head h1 {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: clamp(40px, 6vw, 72px);
  line-height: var(--display-leading);
  letter-spacing: var(--display-tracking);
  margin: 0;
}
.page-head > .short-rule:last-child { margin-bottom: 4px; }
.page-head p { max-width: 52ch; margin: 18px auto 0; font-size: 19px; }

/* ---- sections ----------------------------------------------------------- */
.section { padding: clamp(44px, 7vh, 80px) var(--edge); border-top: var(--rule); }
.section.flush-top { border-top: 0; padding-top: clamp(28px, 4vh, 44px); }
.section.tint { background: var(--surface); }
.wrap { max-width: var(--wide); margin: 0 auto; }
.section-head { text-align: center; margin-bottom: 36px; }
.section-head h2 {
  font-family: var(--font-display);
  font-weight: var(--head-weight);
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1;
  letter-spacing: var(--head-tracking);
  margin: 0;
}
.section-head .short-rule { margin: 20px auto 0; }
.more { text-align: center; margin-top: 28px; font-weight: 600; }
.prose { max-width: var(--measure); margin: 0 auto; font-size: 18px; line-height: 1.65; }
.prose p { margin: 0 0 1.1em; }

/* ---- centered columns (home: what I work on) -------------------------- */
.cols3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 44px 48px;
  text-align: center;
}
.col { display: flex; flex-direction: column; align-items: center; }
.col h3 {
  font-family: var(--font-display);
  font-weight: var(--title-weight);
  font-size: clamp(19px, 1.8vw, 23px);
  line-height: 1.15;
  letter-spacing: var(--title-tracking);
  margin: 0;
}
.col p { margin: 12px 0 0; max-width: 32ch; font-size: 16px; }
.col .tags { justify-content: center; margin-top: 16px; }

/* ---- centered entries (selected work, education, experience) ----------- */
.entries { max-width: var(--measure); margin: 0 auto; }
.entry { max-width: var(--measure); margin-left: auto; margin-right: auto; text-align: center; }
.entry:not([hidden]) ~ .entry:not([hidden]) { margin-top: 44px; }
.entry .when {
  font-family: var(--font-label);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0 0 8px;
}
.entry h3 {
  font-family: var(--font-display);
  font-weight: var(--title-weight);
  font-size: clamp(20px, 1.9vw, 25px);
  line-height: 1.2;
  letter-spacing: var(--title-tracking);
  margin: 0;
}
.entry h3 a { text-decoration: none; }
.entry h3 a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }
.entry p:not(.when) { margin: 8px auto 0; max-width: 52ch; }

/* ---- tags --------------------------------------------------------------- */
/* Plain labels separated by dots. Boxes are reserved for things you can click. */
.tags { display: flex; flex-wrap: wrap; gap: 4px 0; }
.tag {
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.tag + .tag::before { content: "·"; margin: 0 9px; }

/* ---- research chapters -------------------------------------------------- */
.chapters { max-width: 720px; margin: 0 auto; }
.chapter { text-align: center; }
.chapter + .chapter { margin-top: 96px; }
.figure { max-width: 520px; margin: 0 auto 30px; border: var(--rule); }
.figure img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; filter: grayscale(1) contrast(1.05); }
.figure figcaption {
  border-top: var(--rule);
  padding: 10px 14px;
  font-family: var(--font-label);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: var(--label-tracking);
  text-transform: var(--label-transform);
  text-align: left;
}
.chapter .when {
  font-family: var(--font-label);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0 0 10px;
}
.chapter h2 {
  font-family: var(--font-display);
  font-weight: var(--head-weight);
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.1;
  letter-spacing: var(--head-tracking);
  margin: 0;
}
.chapter p:not(.when) { max-width: 58ch; margin: 16px auto 0; font-size: 18px; line-height: 1.6; }
.chapter .tags { margin-top: 18px; }

/* ---- buttons ------------------------------------------------------------ */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
  padding: 12px 18px;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.btn-line { background: transparent; color: var(--ink); }
.btn-line:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 24px; }

/* ---- work page ---------------------------------------------------------- */
.filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 56px; }
.filter {
  font-family: var(--font-label);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: transparent;
  color: var(--ink);
  border: 2px solid var(--ink);
  padding: 7px 14px;
  cursor: pointer;
}
.filter:hover { border-color: var(--accent); color: var(--accent); }
.filter[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.year-group { margin-bottom: 64px; }
.year-group:last-child { margin-bottom: 0; }
.year {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(52px, 8vw, 104px);
  line-height: 1;
  letter-spacing: var(--display-tracking);
  text-align: center;
  margin: 0 0 36px;
}
.entry .authors strong { font-weight: 700; }
.entry .tags, .chapter .tags { justify-content: center; margin-top: 14px; }
.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 16px; }
.links a {
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  border: 2px solid var(--ink);
  padding: 5px 11px;
}
.links a:hover { background: var(--ink); color: var(--paper); }

/* ---- footer ------------------------------------------------------------- */
.foot {
  border-top: var(--rule);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 28px;
  padding: 14px var(--edge);
  font-family: var(--font-label);
  font-size: 12px;
  letter-spacing: var(--label-tracking);
  text-transform: var(--label-transform);
}
.foot a { text-decoration: none; }
.foot a:hover { text-decoration: underline; }
.toggle {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  background: transparent;
  color: var(--ink);
  border: 2px solid var(--ink);
  padding: 6px 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.toggle:hover { border-color: var(--accent); color: var(--accent); }

/* ---- small screens ------------------------------------------------------ */
@media (max-width: 720px) {
  .cols3 { grid-template-columns: 1fr; }
  body { font-size: 16px; }
}

/* ---- profile links + QR codes above the footer (from the business card) ---- */
.card-links { border-top: var(--rule); padding: 40px var(--edge) 36px; text-align: center; }
.qr-grid { display: flex; justify-content: center; flex-wrap: wrap; gap: 28px clamp(20px, 5vw, 56px); }
.qr {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  text-decoration: none; font-family: var(--font-label); font-size: 12px;
  letter-spacing: var(--label-tracking);
}
.qr img {
  width: 112px; height: 112px; margin-bottom: 8px; border: var(--rule);
  background: #fff; /* QR codes stay black on white in both themes so phones can scan them */
}
.qr .qr-title { font-weight: 600; font-size: 13px; }
.qr .qr-title { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.qr:hover .qr-title { color: var(--accent); }
.contact-line { margin: 28px 0 0; font-family: var(--font-label); font-size: 13px; letter-spacing: var(--label-tracking); }
.contact-address { font-size: 14px; line-height: 1.6; }
