/* A page from a well-set book: one column, a serif for reading (Literata),
   JetBrains Mono for dates and metadata, one accent colour (Kotlin violet). */
:root {
  color-scheme: light dark;
  --bg: #fdfcf8;
  --text: #1d1b19;
  --muted: #6b6560;
  --rule: #e6e1d8;
  --accent: #6b3fe0;
  --serif: "Literata", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --measure: 680px;
  --fs-small: 13px;   /* all mono text */
  --fs-meta: 15.5px;  /* secondary serif text */
  --fs-body: 18px;
  --fs-lead: 20px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #171615; --text: #ece8e1; --muted: #a8a197; --rule: #2e2b28; --accent: #b39dff; }
  .book img, .thumb, .mini-cover { outline: 1px solid rgb(255 255 255 / .07); }
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 var(--fs-body)/1.7 var(--serif);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
img { display: block; max-width: 100%; height: auto; }
cite { font-style: italic; }

.wrap { max-width: calc(var(--measure) + 32px); margin: 0 auto; padding: 0 16px; }

/* header */
.top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px 16px; flex-wrap: wrap; padding-top: 28px; }
.name { color: var(--text); text-decoration: none; font-weight: 600; }
nav { display: flex; gap: 20px; font-family: var(--mono); font-size: var(--fs-small); flex-wrap: wrap; }
nav a { color: var(--muted); text-decoration: none; }
nav a:hover { color: var(--text); }
nav a[aria-current="page"] { color: var(--text); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 6px; }
nav .lang { padding-left: 20px; border-left: 1px solid var(--rule); }

main { padding-bottom: 64px; }

h1 { font-size: clamp(34px, 6vw, 44px); font-weight: 600; line-height: 1.15; letter-spacing: -.015em; margin: 64px 0 6px; }
h2 {
  font-family: var(--mono); font-size: var(--fs-small); font-weight: 500; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); margin: 64px 0 20px; padding-bottom: 8px; border-bottom: 1px solid var(--rule);
}
.subtitle { font-style: italic; color: var(--muted); font-size: var(--fs-lead); margin: 0 0 8px; }
.subtitle a { font-style: normal; font-family: var(--mono); font-size: var(--fs-small); white-space: nowrap; }

/* about */
.intro { display: flex; align-items: center; gap: 24px; margin-top: 64px; }
.intro h1 { margin: 0 0 4px; }
.portrait { width: 112px; height: 112px; border-radius: 50%; object-fit: cover; object-position: 50% 20%; flex: none; }
.prose { margin-top: 32px; }
.prose p, .prose ul { margin: 0 0 1.1em; }
.prose li { margin-bottom: .4em; }
.prose li::marker { color: var(--muted); }
.prose h2 { margin-top: 48px; }
.contact { padding: 14px 18px; border-left: 2px solid var(--accent); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.elsewhere, .ctas { font-family: var(--mono); font-size: var(--fs-small); color: var(--muted); }
.elsewhere a { white-space: nowrap; }
.ctas { display: flex; flex-wrap: wrap; gap: 6px 24px; }

/* shelf */
.shelf { display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; }
.book { color: var(--text); text-decoration: none; }
.book img {
  aspect-ratio: 2 / 3; width: 100%; object-fit: cover; border-radius: 2px 4px 4px 2px;
  box-shadow: 0 1px 2px rgb(0 0 0 / .12), 0 8px 18px -8px rgb(0 0 0 / .35);
  transition: transform .2s;
}
.book span { display: block; margin-top: 10px; font-size: 14px; line-height: 1.3; }
.book:hover img { transform: translateY(-3px); }
.book:hover span { color: var(--accent); }

/* lists (projects, conf) */
.items { list-style: none; padding: 0; margin: 0; }
.items li { margin: 0 0 20px; }
.items li.with-cover { display: grid; grid-template-columns: 48px 1fr; gap: 16px; align-items: start; }
.mini-cover { width: 48px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 1px 3px 3px 1px; box-shadow: 0 4px 10px -4px rgb(0 0 0 / .4); margin-top: 4px; }
.items .head { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; }
.items .head a, .items .head b { font-weight: 600; line-height: 1.35; color: var(--text); text-decoration-color: var(--rule); }
.items .head a:hover { color: var(--accent); text-decoration-color: currentColor; }
.items p { margin: 2px 0 0; color: var(--muted); font-size: var(--fs-meta); line-height: 1.6; }
.meta { font-family: var(--mono); font-size: var(--fs-small); color: var(--muted); white-space: nowrap; }
a.meta { color: var(--accent); text-decoration: none; }
.group-desc { color: var(--muted); font-style: italic; margin: -8px 0 20px; font-size: var(--fs-meta); }
section[id] { scroll-margin-top: 24px; }

/* galleries: games and featured recordings */
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px 20px; }
.tile { display: flex; flex-direction: column; gap: 4px; color: var(--text); text-decoration: none; }
.tile .thumb { display: block; position: relative; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 6px; margin-bottom: 8px; background: var(--rule); box-shadow: 0 1px 2px rgb(0 0 0 / .1), 0 10px 22px -12px rgb(0 0 0 / .4); }
.tile .thumb.video { aspect-ratio: 16 / 9; }
.tile .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s, filter .25s; }
.tile .thumb.video img { filter: saturate(.75); }
.tile .thumb.video::after {
  content: ""; position: absolute; left: 10px; bottom: 10px; width: 34px; height: 34px; border-radius: 50%;
  background: rgb(0 0 0 / .6) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 7v10l8-5z' fill='white'/%3E%3C/svg%3E") center / 20px no-repeat;
}
a.tile:hover .thumb img, a.tile:focus-visible .thumb img { transform: scale(1.03); filter: none; }
a.tile:hover b { color: var(--accent); }
.tile b { font-weight: 600; line-height: 1.35; }
.tile .desc { color: var(--muted); font-size: var(--fs-meta); line-height: 1.5; }

/* talks */
.filters { display: flex; flex-wrap: wrap; gap: 4px 18px; font-family: var(--mono); font-size: var(--fs-small); }
.filters button { font: inherit; background: none; border: 0; padding: 2px 0; color: var(--muted); cursor: pointer; }
.filters button .n { opacity: .65; }
.filters button:hover { color: var(--text); }
.filters button[aria-pressed="true"] { color: var(--accent); text-decoration: underline; text-underline-offset: 5px; }
.count { font-family: var(--mono); font-size: var(--fs-small); color: var(--muted); margin: 8px 0 0; }
.year h3 { font-family: var(--mono); font-size: 15px; font-weight: 500; margin: 36px 0 6px; }
.talks { list-style: none; padding: 0; margin: 0; }
.talks li { display: grid; grid-template-columns: 72px 1fr; gap: 0 16px; padding: 9px 0; }
.talks time { font-family: var(--mono); font-size: var(--fs-small); color: var(--muted); padding-top: 4px; }
.talks .title { font-weight: 500; line-height: 1.4; color: var(--text); }
.talks a.title { text-decoration-color: var(--rule); }
.talks a.title:hover { color: var(--accent); text-decoration-color: currentColor; }
.talks .marker { font-family: var(--mono); font-size: 11px; color: var(--accent); margin-left: 8px; vertical-align: 2px; }
.talks .where { color: var(--muted); font-size: var(--fs-meta); line-height: 1.5; margin-top: 2px; }
.talks .kind { font-family: var(--mono); font-size: var(--fs-small); margin-left: 4px; }
#tab-about .talks li, main > .talks li { grid-template-columns: 80px 1fr; }

footer {
  display: flex; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap;
  padding: 24px 0 48px; border-top: 1px solid var(--rule);
  font-family: var(--mono); font-size: var(--fs-small); color: var(--muted);
}
footer a { color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

@media (max-width: 560px) {
  body { font-size: 17px; }
  .intro { flex-direction: column; align-items: flex-start; gap: 16px; margin-top: 40px; }
  .portrait { width: 88px; height: 88px; }
  .shelf { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 14px; padding-bottom: 8px; }
  .book { flex: 0 0 108px; scroll-snap-align: start; }
  .gallery { grid-template-columns: 1fr; }
  .talks li, main > .talks li { grid-template-columns: 1fr; }
  .items .head { flex-direction: column; gap: 0; }
  nav { gap: 14px; }
  nav .lang { padding-left: 14px; }
  h1 { margin-top: 40px; }
}
