/* christopher.you: Newsreader + Hanken Grotesk, colors from the CV (blue #63A8CA, name green #52905C). */

:root {
  --paper: #f6f7f5;
  --surface: #ffffff;
  --ink: #1e2b33;
  --muted: #5b6770;
  --blue: #2f6f8f;
  --blue-soft: #e3eef3;
  --green: #3f7a49;
  --rule: #d5dbdd;
  --on-blue: #ffffff;
  --shadow: 0 1px 0 rgba(30, 43, 51, 0.06), 0 8px 24px -16px rgba(30, 43, 51, 0.25);
  --serif: "Newsreader", Georgia, serif;
  --sans: "Hanken Grotesk", system-ui, sans-serif;
  --wrap: 1080px;
  --gutter: 32px;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #131a1e;
    --surface: #1b242a;
    --ink: #e3e8ea;
    --muted: #9aa7ae;
    --blue: #86bcd8;
    --blue-soft: #1f3440;
    --on-blue: #10171b;
    --green: #8fcb99;
    --rule: #2c373d;
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 8px 24px -16px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #131a1e;
  --surface: #1b242a;
  --ink: #e3e8ea;
  --muted: #9aa7ae;
  --blue: #86bcd8;
  --blue-soft: #1f3440;
  --on-blue: #10171b;
  --green: #8fcb99;
  --rule: #2c373d;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 8px 24px -16px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.6;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 3px; }
.muted { color: var(--muted); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

/* --- top bar ------------------------------------------------------------------ */
.topbar {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
  font-family: var(--sans);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 60px; }
.wordmark { font-family: var(--serif); font-size: 21px; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.topbar nav { display: flex; gap: 26px; font-size: 15px; }
.topbar nav a { color: var(--ink); text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; }
.topbar nav a:hover { color: var(--blue); }
.topbar nav a[aria-current="page"] { color: var(--blue); border-bottom-color: var(--blue); }
.topbar-right { display: flex; align-items: center; gap: 22px; }
.theme-toggle {
  display: grid; place-items: center; width: 34px; height: 34px; flex: none;
  border: 1px solid var(--rule); border-radius: 50%; background: var(--surface); color: var(--ink); cursor: pointer;
}
.theme-toggle:hover { color: var(--blue); border-color: var(--blue); }
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: block; }
}

/* --- hero conversation ---------------------------------------------------------- */
.hero { padding: 56px 0 64px; border-bottom: 1px solid var(--rule); }
.hero-inner { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr); gap: 56px; align-items: center; }
.chat { display: flex; flex-direction: column; gap: 12px; }
.turn { display: flex; gap: 14px; align-items: flex-end; }
.avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex: none; }
.avatar-space { width: 56px; flex: none; }
.bubble {
  background: var(--surface);
  border-radius: 22px 22px 22px 6px;
  padding: 14px 20px;
  box-shadow: var(--shadow);
  max-width: 54ch;
}
.bubble.big {
  font-size: 42px; line-height: 1.12; font-weight: 300; letter-spacing: -0.015em;
  padding: 22px 26px 24px;
}
.bubble.user {
  align-self: flex-end;
  background: var(--blue); color: var(--on-blue);
  border-radius: 22px 22px 6px 22px;
  font-family: var(--sans); font-size: 16px; padding: 11px 18px;
}
.bubble.answer { font-size: 18px; }
.bubble.typing { display: none; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 0 70px; font-family: var(--sans); }
.chip {
  display: inline-block; padding: 8px 16px; border-radius: 999px;
  border: 1.5px solid var(--blue); color: var(--blue);
  font-size: 15px; font-weight: 500; text-decoration: none;
}
.chip:hover { background: var(--blue-soft); }
.chip.solid { background: var(--blue); color: var(--on-blue); }
.chip.solid:hover { background: color-mix(in srgb, var(--blue) 85%, black); }

.mosaic { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 10px; aspect-ratio: 1 / 0.92; }
.mosaic img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); }
.mosaic img:first-child { grid-column: 1 / -1; }

/* the question is a button: clicking it "sends" it and the agent answers (site.js) */
.ask {
  align-self: flex-end; display: inline-flex; align-items: center; gap: 10px;
  font: 500 16px/1.2 var(--sans); color: var(--blue); cursor: pointer;
  background: var(--surface); border: 1.5px solid var(--blue);
  border-radius: 22px 22px 6px 22px; padding: 11px 12px 11px 16px;
  box-shadow: var(--shadow);
}
.ask[hidden] { display: none; }
.ask svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; flex: none; }
.ask-hint {
  font-size: 13px; font-weight: 600; color: var(--on-blue); background: var(--blue);
  border-radius: 999px; padding: 4px 10px;
}
.ask:hover { background: var(--blue-soft); }
.ask:active { transform: translateY(1px); }
@media (prefers-reduced-motion: no-preference) {
  .ask { animation: nudge 2.4s ease-in-out 1s 2; }
}
@keyframes nudge {
  0%, 100% { box-shadow: var(--shadow), 0 0 0 0 color-mix(in srgb, var(--blue) 45%, transparent); }
  50% { box-shadow: var(--shadow), 0 0 0 8px color-mix(in srgb, var(--blue) 0%, transparent); }
}
.chat [hidden] { display: none; }
.chat .enter { animation: rise 0.35s ease-out both; }
@media (prefers-reduced-motion: reduce) { .chat .enter { animation: none; } }
.chat.typing-now .typing { display: inline-flex; gap: 5px; padding: 16px 18px; }
.chat.typing-now .answer { display: none; }
.answer:focus { outline: none; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1s infinite ease-in-out; }
.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

/* --- banded sections (label gutter + body) ------------------------------------- */
.band { border-bottom: 1px solid var(--rule); }
.band-inner { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 32px; padding: 48px var(--gutter); }
.band-label { font-family: var(--sans); font-size: 15px; font-weight: 600; color: var(--muted); padding-top: 6px; }
.band-body > p { max-width: 64ch; }
.more { margin-top: 20px; font-family: var(--sans); font-size: 15px; }

.about { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 32px; align-items: start; }
.about-text p { max-width: 62ch; margin-bottom: 14px; }
.about .lede { font-size: 22px; line-height: 1.45; }
.boba { align-self: start; text-align: center; }
.boba img { width: 100%; height: auto; border-radius: 50%; box-shadow: var(--shadow); }
.boba figcaption { font-family: var(--sans); font-size: 13px; color: var(--muted); margin-top: 8px; }

/* news cards */
.cards { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.card-body { padding: 16px 18px 18px; }
.card time { font-family: var(--sans); font-size: 13px; color: var(--muted); }
.card h3 { font-size: 20px; font-weight: 500; line-height: 1.25; margin: 4px 0 6px; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a:hover { color: var(--blue); text-decoration: underline; }
.card p { font-size: 16px; line-height: 1.5; color: var(--muted); }

/* project tiles (home) */
.tiles { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.tiles a { display: flex; flex-direction: column; gap: 6px; color: var(--ink); text-decoration: none; }
.tiles img { aspect-ratio: 16 / 10; width: 100%; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 6px; }
.tile-title { font-size: 20px; font-weight: 500; line-height: 1.25; }
.tiles a:hover .tile-title { color: var(--blue); text-decoration: underline; }
.tile-text { font-size: 16px; line-height: 1.5; color: var(--muted); }

/* --- publications ---------------------------------------------------------------- */
.pubs { list-style: none; padding: 0; }
.pub { padding: 14px 0 16px; border-top: 1px solid var(--rule); max-width: 72ch; scroll-margin-top: 80px; }
.pub:first-child { border-top: 0; padding-top: 0; }
.pub:target { background: var(--blue-soft); box-shadow: 0 0 0 12px var(--blue-soft); border-radius: 2px; }
.pub-title { font-size: 20px; line-height: 1.35; font-weight: 500; }
.pub-title a { color: var(--ink); text-decoration: none; }
.pub-title a:hover { color: var(--blue); text-decoration: underline; }
.pub-authors { font-size: 16.5px; margin-top: 3px; }
.pub-authors .me { color: var(--green); font-weight: 600; }
.pub-venue { font-size: 16.5px; color: var(--muted); }
.pub-actions { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 6px; font-family: var(--sans); font-size: 14px; align-items: baseline; }
.pdfnote { color: var(--muted); font-size: 13px; }
.cat, .status {
  display: inline-block; font-family: var(--sans); font-size: 12px; font-weight: 500;
  line-height: 1; padding: 4px 7px 4px; border-radius: 4px; margin-right: 6px; vertical-align: 3px;
}
.cat { border: 1px solid var(--rule); color: var(--muted); }
.status { background: var(--blue-soft); color: var(--blue); }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--blue); cursor: pointer; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.bibtex {
  margin-top: 10px; padding: 12px 14px; background: var(--surface); border-radius: 6px; box-shadow: var(--shadow);
  font-size: 13px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; position: relative;
}

.page-head { padding-top: 48px; padding-bottom: 24px; }
.page-head h1 { font-size: 52px; font-weight: 300; letter-spacing: -0.02em; line-height: 1.05; margin-bottom: 12px; }
.page-head > p { max-width: 64ch; }
.page-head .chips { margin: 20px 0 0; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; font-family: var(--sans); }
.filter {
  font: inherit; font-size: 14px; padding: 6px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--rule); background: var(--surface); color: var(--ink);
}
.filter span { color: var(--muted); margin-left: 2px; }
.filter[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.filter[aria-pressed="true"] span { color: inherit; opacity: 0.7; }

.year-group { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 32px; padding: 28px 0; border-top: 1px solid var(--rule); }
.year { font-size: 36px; font-weight: 300; font-style: italic; color: var(--blue); line-height: 1; }
.year-group[hidden] { display: none; }
.pub-list, .news-list { padding-bottom: 56px; }

/* --- news list ------------------------------------------------------------------------ */
.dated { list-style: none; padding: 0; }
.dated li { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 16px; padding: 10px 0 14px; max-width: 72ch; }
.dated time { font-family: var(--sans); font-size: 14px; color: var(--muted); padding-top: 4px; }
.dated h3 { font-size: 20px; font-weight: 500; line-height: 1.3; }
.dated h3 a { color: var(--ink); }
.dated p { font-size: 17px; color: var(--muted); }

.controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-top: 8px; }
.controls .filters { margin-top: 0; }
.sort { font-family: var(--sans); font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.sort select {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--rule);
  border-radius: 999px; padding: 6px 12px; cursor: pointer;
}
.project[hidden] { display: none; }

/* --- projects ---------------------------------------------------------------------------- */
.projects { padding-bottom: 56px; }
.project { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 40px; padding: 40px 0; border-top: 1px solid var(--rule); scroll-margin-top: 70px; }
.project-media { display: flex; flex-direction: column; gap: 10px; }
.project-media > img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); }
.project-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-family: var(--sans); font-size: 14px; color: var(--muted); }
.project-meta > span:first-child { margin-right: 4px; }
.tag { border: 1px solid var(--rule); border-radius: 999px; padding: 1px 10px; font-size: 13px; }
.project h2 { font-size: 32px; font-weight: 400; line-height: 1.15; letter-spacing: -0.01em; margin: 10px 0 4px; }
.project-sub { font-style: italic; color: var(--muted); margin-bottom: 14px; }
.project-text > p { max-width: 62ch; margin-bottom: 12px; }
.tech { font-family: var(--sans); font-size: 15px; }
.project-links { font-family: var(--sans); font-size: 15px; display: flex; gap: 16px; }
.related { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--rule); }
.related h3 { font-family: var(--sans); font-size: 14px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.related ul { list-style: none; padding: 0; font-size: 17px; }
.related li { margin-bottom: 6px; line-height: 1.4; }
.related .muted { font-family: var(--sans); font-size: 13px; }
.video {
  position: relative; display: block; width: 100%; padding: 0; border: 0; cursor: pointer; background: #000;
  aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.video img { width: 100%; height: 100%; object-fit: cover; opacity: 0.8; }
.video span {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.7); color: #fff; font-family: var(--sans); font-size: 15px;
  padding: 10px 18px 10px 38px; border-radius: 999px;
}
.video span::before {
  content: ""; position: absolute; left: 17px; top: 50%; transform: translateY(-50%);
  border-left: 12px solid #fff; border-top: 7px solid transparent; border-bottom: 7px solid transparent;
}
.video:hover span { background: var(--blue); }
.video iframe { width: 100%; height: 100%; border: 0; display: block; }

.lost { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 32px; align-items: center; padding-bottom: 64px; }
.lost img { width: 100%; height: auto; }

/* --- CV ------------------------------------------------------------------------------------ */
.pdf { width: 100%; height: 85vh; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); margin-bottom: 56px; }

/* --- footer ---------------------------------------------------------------------------------- */
.footer { font-family: var(--sans); font-size: 15px; padding: 32px 0 48px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: baseline; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer .muted { margin-left: auto; }

/* --- responsive -------------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 32px; }
  .mosaic { aspect-ratio: 16 / 11; max-width: 560px; }
  .cards, .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project { grid-template-columns: 1fr; gap: 20px; }
}
@media (max-width: 720px) {
  :root { --gutter: 18px; }
  body { font-size: 18px; }
  .topbar-inner { height: auto; flex-direction: column; align-items: stretch; gap: 0; padding-top: 10px; position: relative; }
  .topbar-right { display: contents; }
  .theme-toggle { position: absolute; right: var(--gutter); top: 8px; width: 32px; height: 32px; }
  .wordmark { font-size: 19px; }
  .topbar nav { gap: 20px; overflow-x: auto; white-space: nowrap; padding: 6px 0 2px; scrollbar-width: none; }
  .topbar nav::-webkit-scrollbar { display: none; }
  .hero { padding: 28px 0 40px; }
  .avatar { width: 44px; height: 44px; }
  .avatar-space { display: none; }
  .turn { gap: 10px; }
  .turn.agent:first-child { flex-direction: column; align-items: flex-start; }
  .bubble.big { font-size: 31px; padding: 18px 20px 20px; }
  .bubble.answer { font-size: 17px; }
  .chips { margin-left: 0; }
  .band-inner, .year-group { grid-template-columns: 1fr; gap: 12px; padding-top: 32px; padding-bottom: 32px; }
  .year-group { padding-left: 0; padding-right: 0; }
  .band-label { padding-top: 0; }
  .about { grid-template-columns: 1fr; }
  .boba { max-width: 180px; }
  .lost { grid-template-columns: 1fr; }
  .lost img { max-width: 240px; }
  .cards, .tiles { grid-template-columns: 1fr; }
  .card.has-img { display: grid; grid-template-columns: 112px minmax(0, 1fr); }
  .card.has-img img { height: 100%; aspect-ratio: auto; }
  .card-body { padding: 12px 14px 14px; }
  .card h3 { font-size: 18px; }
  .card p { font-size: 15px; }
  .page-head h1 { font-size: 40px; }
  .year { font-size: 30px; }
  .project h2 { font-size: 27px; }
  .pdf { display: none; }
  .footer .muted { margin-left: 0; }
}
@media print {
  .topbar, .footer, .filters, .chips, .mosaic, .video { display: none; }
}

:root[data-theme="light"] { color-scheme: light; }
.archive-list { font-family: var(--sans); font-size: 16px; line-height: 2; padding-left: 20px; margin-bottom: 56px; }
