/* Fonts, self-hosted so a visit makes no request to Google (SIL Open Font License, see
   assets/fonts/OFL-*.txt). Inter is a variable font: one file covers weights 400 to 700.
   Subsets latin and latin-ext, as served by Google Fonts (Inter v20, Press Start 2P v16). */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(fonts/inter-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(fonts/inter-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Press Start 2P';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/press-start-2p-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Press Start 2P';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/press-start-2p-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* jvitorcosta.github.io: Game Boy menu look, shared by the homepage and the case-study pages.
   Palettes live on <html> (.pal-night is Mandarin, .pal-nu); site.js picks one and marks it
   with data-pal. Every text pair below passes WCAG AA (tests/test_assets.py checks them). */

.pal-night { --bg:#8f1d1d; --box:#f5e6c8; --ink:#3a1410; --line:#8a5a12; --shadow:#4a0b0b; --soft:#ead2a8; --accent:#a3161a; --hp:#e0a91b; --ink-on-bg:#fff3d6; --strava:#b03600; --strava-decoration:underline; color-scheme:light; }
.pal-nu { --bg:#820ad1; --box:#f7f0e1; --ink:#2a0845; --line:#2a0845; --shadow:#4a0478; --soft:#e9dcc2; --accent:#820ad1; --hp:#ffb703; --ink-on-bg:#ffffff; --strava:#c43d00; --strava-decoration:underline; color-scheme:light; }


/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
/* Bilingual spans: show the page language only. Descendant selectors, so <html> itself never hides. */
html[lang=pt] [lang=en], html[lang=en] [lang=pt] { display: none; }

html { background: var(--bg); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink-on-bg);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  overflow-wrap: break-word;
}
img { max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 3px solid currentColor; outline-offset: 2px; }

.px, .h, .k, .lv, .badge, [data-lang-toggle], .ask-open {
  font-family: "Press Start 2P", ui-monospace, monospace;
  font-weight: 400;
  letter-spacing: .5px;
}
/* First thing the keyboard reaches: hidden until focused, then jumps past the palette and language buttons. */
.skip {
  position: absolute; left: 8px; top: -100px; z-index: 10;
  padding: 10px 14px; font: 600 15px/1.2 Inter, system-ui, sans-serif;
  color: var(--ink); background: var(--box); border: 3px solid var(--line); border-radius: 4px;
}
.skip:focus { top: 8px; outline: 3px solid var(--accent); outline-offset: 2px; }
.sr {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* One centred column: full width on a phone (from 360px), at most 480px on a desktop. */
main, body > header.top, body > footer.foot {
  display: block;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding-left: 12px;
  padding-right: 12px;
}
main { padding-top: 12px; padding-bottom: 28px; }
/* The homepage footer sits after <main> (a contentinfo landmark); the column padding moves to it. */
main:has(+ footer.foot) { padding-bottom: 0; }
body > footer.foot { margin-top: 8px; padding-bottom: 28px; }
body > header.top { display: flex; flex-wrap: wrap; padding-top: 12px; }
main > header.top { padding: 0; }

/* Homepage on a wide screen: two columns, who I am, my projects and my work on the left, the live
   rows and the PC box on the right. Case pages keep the narrow reading column. */
@media (min-width: 900px) {
  main:has(> .cols), body:has(.cols) > footer.foot { max-width: 1000px; }
  .cols { display: flex; gap: 16px; align-items: flex-start; }
  .col { flex: 1; min-width: 0; }
}
/* Phones: one column. The trainer card, the latest post and what I'm studying come first, in code
   order; then Lately, Favorites, the PC box, and Work at the end. */
@media (max-width: 899px) {
  .cols { display: flex; flex-direction: column; }
  .col { display: contents; }
  #right-now { order: 1; }
  #party { order: 2; }
  #pc-box { order: 3; }
  #work { order: 4; }
}

/* ---------- top bar: palette dots, language, back link ---------- */
.top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 0 0 10px; }
.sw, .palettes { display: flex; gap: 2px; }

/* A 26px dot inside a 44px tap target. */
[data-palette] {
  position: relative;
  width: 44px; height: 44px;
  padding: 9px;
  border: 0;
  border-radius: 50%;
  background-clip: content-box !important;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
[data-palette=night] { background-color: #d4a72c; }
[data-palette=nu] { background-color: #820ad1; }
[data-palette]::before, [data-palette][aria-pressed=true]::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 3px solid var(--ink-on-bg);
}
[data-palette]::before { inset: 9px; }
[data-palette][aria-pressed=true]::after { inset: 2px; }
[data-palette]:focus-visible { outline: 3px solid var(--ink-on-bg); outline-offset: 0; }

/* The active palette's name, next to the dots. */
.sw { align-items: center; }
.pname { margin-left: 8px; font-size: 12px; line-height: 1.4; color: var(--ink-on-bg); }
.pn { display: none; }
.pal-night .pn-night, .pal-nu .pn-nu { display: inline; }

[data-lang-toggle], .ask-open {
  min-width: 44px; min-height: 44px;
  padding: 0 10px;
  font-size: 12px;
  color: var(--ink-on-bg);
  background: transparent;
  border: 3px solid var(--ink-on-bg);
  border-radius: 4px;
  cursor: pointer;
}
[data-lang-toggle]:focus-visible, .ask-open:focus-visible { outline-color: var(--ink-on-bg); }
.ask-open { margin-left: auto; }
/* Both languages show; the current one is a filled chip (shape, not colour alone). */
[data-lang-toggle] span { padding: 2px 4px; border-radius: 2px; }
html[lang=en] [data-lang-toggle] .l-en, html[lang=pt] [data-lang-toggle] .l-pt { color: var(--bg); background: var(--ink-on-bg); }

header.top > a {
  display: inline-flex; align-items: center;
  min-height: 44px;
  padding: 0 4px;
  color: var(--ink-on-bg);
  font-weight: 700;
  text-decoration: none;
}
header.top > a:hover { text-decoration: underline; }
/* The BLOG link looks like the language button. */
header.top > a.top-link { margin-left: auto; padding: 0 10px; font-size: 12px; border: 3px solid var(--ink-on-bg); border-radius: 4px; }
header.top > a.top-link:hover { text-decoration: none; background: rgba(255, 255, 255, .12); }

/* ---------- boxes ---------- */
.box {
  margin: 0 0 16px;
  padding: 14px;
  background: var(--box);
  color: var(--ink);
  border: 4px solid var(--line);
  border-radius: 6px;
  box-shadow: 4px 4px 0 var(--shadow);
}
.h {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap;
  gap: 4px 8px;
  margin: 0 0 4px;
  font-size: 16px; /* the pixel font's 8px grid: sharp at 8, 16, 24 */
  line-height: 1.6;
}
.h a {
  display: inline-flex; align-items: center;
  min-height: 44px;
  font-family: Inter, system-ui, sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--accent);
  text-decoration: none;
}
.h a:hover { text-decoration: underline; }
.cursor { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.small { margin: 0; font-size: 15px; line-height: 1.5; }
.motto { margin: 6px 0 0; font-size: 14px; font-style: italic; color: var(--accent); }
#work .small { margin: 8px 0 0; }
/* Work: one line per role, title in bold over company and dates. */
.jobs { list-style: none; margin: 10px 0 0; padding: 0; font-size: 14px; line-height: 1.45; }
.jobs li { padding: 8px 0; border-bottom: 2px dotted var(--soft); }
.jobs li:last-child { border-bottom: 0; }
.jobs b { display: block; font-size: 15px; }
/* A role that opens (native details): the whole title block is the button, with a chevron. */
.job > summary { position: relative; min-height: 44px; padding: 2px 28px 2px 0; cursor: pointer; list-style: none; }
.job > summary::-webkit-details-marker { display: none; }
.job > summary::after { content: "▶"; position: absolute; right: 4px; top: 50%; margin-top: -8px; font-size: 12px; color: var(--accent); transition: transform .12s; }
.job[open] > summary::after { transform: rotate(90deg); }
.job > summary:hover b { text-decoration: underline; }
.job > summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.job .did { padding: 4px 0 8px; font-size: 13.5px; line-height: 1.5; }
/* A headed group of bullets is a small disclosure inside the open role. */
.grp { border-top: 2px dotted var(--soft); }
.grp > summary { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; padding: 0 28px 0 0; cursor: pointer; list-style: none; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.grp > summary::-webkit-details-marker { display: none; }
.grp > summary::after { content: "▶"; position: absolute; right: 4px; top: 50%; margin-top: -7px; font-size: 11px; transition: transform .12s; }
.grp[open] > summary::after { transform: rotate(90deg); }
.grp > summary:hover span:first-child { text-decoration: underline; }
.grp > summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.grp .n { flex: none; min-width: 22px; padding: 0 6px; text-align: center; font-size: 11px; color: var(--ink); background: var(--soft); border-radius: 3px; }
.job .did ul { margin: 4px 0 0; padding: 0 0 0 18px; }
.job .did li { margin: 0 0 6px; padding: 0; border: 0; }
.jobs .hint { margin-bottom: 0; }
/* A blog post: a reading column inside the usual pixel box. */
.blog-list .row { display: block; }
.blog-list .meta { margin: 2px 0 4px; }
.post .crumb { margin: 0 0 10px; font-size: 14px; }
.post-title { margin: 0 0 6px; font: 400 18px/1.5 "Press Start 2P", monospace; color: var(--ink); }
.post .meta { margin: 0 0 8px; font-size: 14px; color: var(--ink); }
.post .tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; padding: 0; list-style: none; }
.post .tags li { padding: 1px 8px; font-size: 12px; color: var(--ink); background: var(--soft); border: 2px solid var(--line); border-radius: 3px; }
.post .cover { margin: 12px 0; }
.prose { max-width: 70ch; font-size: 16px; line-height: 1.65; }
.prose h2 { margin: 26px 0 8px; font-size: 13px; line-height: 1.6; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); font-family: "Press Start 2P", monospace; font-weight: 400; }
.prose h3 { margin: 18px 0 6px; font-size: 16px; color: var(--ink); }
.prose p, .prose ul, .prose ol, .prose pre, .prose blockquote, .prose figure { margin: 0 0 14px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin: 0 0 4px; }
.prose a { color: var(--accent); text-underline-offset: 3px; }
.prose code { padding: 1px 4px; font: 14px/1.4 ui-monospace, Consolas, monospace; background: var(--soft); border-radius: 3px; }
.prose pre { overflow-x: auto; padding: 12px; background: var(--soft); border: 2px solid var(--line); border-radius: 3px; }
.prose pre code { padding: 0; background: none; font-size: 13.5px; line-height: 1.5; }
.prose blockquote { padding: 2px 14px; border-left: 4px solid var(--line); }
.prose figure img, .post .cover img { display: block; max-width: 100%; height: auto; image-rendering: auto; border: 3px solid var(--line); }
.prose figcaption { margin-top: 6px; font-size: 13.5px; }
.menu .upd { display: block; margin-top: 3px; font-size: 12px; color: var(--ink); }
.hint .click { display: none; }
@media (hover: hover) and (pointer: fine) { .hint .tap { display: none; } .hint .click { display: inline; } }
@media (prefers-reduced-motion: reduce) { .job > summary::after, .grp > summary::after { transition: none; } }
#work .aside { margin-top: 12px; font-size: 14px; }
#work .aside a {
  display: inline-flex; align-items: center; min-height: 44px;
  color: var(--ink); text-underline-offset: 3px;
}

/* Trainer card */
.trainer { display: flex; gap: 12px; align-items: center; }
.ava {
  flex: none;
  display: block;
  width: 72px; height: 72px;
  padding: 4px;
  box-sizing: border-box;
  background: var(--bg); /* the portrait is transparent, so it takes the palette's colour */
  border: 3px solid var(--line);
}
h1.name { margin: 0 0 8px; font-size: 14px; line-height: 1.5; }
/* The pixel font has no Chinese glyphs: use a system CJK font, kept on one line. */
h1.name .zh, .h .zh {
  display: inline-block; white-space: nowrap;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", "Noto Sans SC", sans-serif;
  font-size: 16px; font-weight: 700; letter-spacing: 0.1em;
}

/* Chunky buttons */
.links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.links a, .links button, .btn {
  display: inline-flex; align-items: center;
  min-height: 44px;
  padding: 0 14px;
  font: 600 15px/1.2 Inter, system-ui, sans-serif;
  color: var(--ink);
  background: var(--box);
  border: 3px solid var(--line);
  border-radius: 4px;
  box-shadow: 3px 3px 0 var(--shadow);
  text-decoration: none;
  cursor: pointer;
}
/* The trainer's contact links are square icon buttons; on a phone TALK, when Ask Vitor is on,
   takes a full row above them. */
#trainer .links a { justify-content: center; width: 48px; min-height: 48px; padding: 0; }
#trainer .links a img { width: 40px; height: 40px; margin: 0; }
@media (max-width: 420px) {
  #trainer .links [data-ask-open] { flex: 1 0 100%; justify-content: center; }
}
/* The resume (in Experience) is the one filled button; the pill sits under the trainer card's motto. */
.links .primary { background: var(--accent); color: var(--ink-on-bg); }
.status {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 10px 0 0; padding: 4px 10px;
  font: 600 13px/1.3 Inter, system-ui, sans-serif;
  color: var(--ink); background: var(--soft);
  border: 2px solid var(--line); border-radius: 999px;
}
.status i { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #1f9d55; }
.links a:hover, .links button:hover, .btn:hover { text-decoration: underline; }
.links a:active, .links button:active, .btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--shadow); }

/* ---------- TALK: the Ask Vitor dialogue (assets/ask.js) ---------- */
/* A game dialogue box under the trainer card; it spans the column, so a phone gets full width. */
.ask { width: 100%; border: 4px solid var(--line); }
/* VITOR: and the close button share a row, so the button never covers the text. */
.ask-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin: 0 0 8px; }
#ask-title { margin: 0; font-family: "Press Start 2P", ui-monospace, monospace; font-size: 12px; font-weight: 400; }
.ask-answer { white-space: pre-line; }
.ask-answer p { margin: 0 0 8px; }
.ask-cursor { display: inline-block; margin-left: 4px; font-size: 10px; animation: ask-blink 1s steps(1) infinite; }
@keyframes ask-blink { 50% { opacity: 0; } }
.ask-sources { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 13px; font-weight: 600; }
.ask-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.ask button {
  min-height: 44px;
  padding: 0 12px;
  font: 600 14px/1.2 Inter, system-ui, sans-serif;
  color: var(--ink);
  background: var(--box);
  border: 3px solid var(--line);
  border-radius: 4px;
  box-shadow: 3px 3px 0 var(--shadow);
  cursor: pointer;
}
/* A 44px target; border, shadow and focus ring come from .ask button. Press Start 2P has no ✕,
   so the glyph comes from a symbol font, bold to match the pixel lines. */
.ask .ask-close {
  flex: none;
  min-width: 44px; min-height: 44px;
  padding: 0;
  font: 700 16px/1 "Segoe UI Symbol", "Apple Symbols", "DejaVu Sans", "Noto Sans Symbols 2", system-ui, sans-serif;
}
.ask button:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--shadow); }
.ask-form { display: flex; gap: 8px; }
.ask-form input {
  flex: 1; min-width: 0; min-height: 44px;
  padding: 0 10px;
  font: 16px Inter, system-ui, sans-serif;
  color: var(--ink);
  background: var(--box);
  border: 3px solid var(--line);
  border-radius: 4px;
}
.ask-form input::placeholder { color: var(--ink); opacity: .7; }
.ask-form [type=submit] { font-family: "Press Start 2P", ui-monospace, monospace; font-weight: 400; }
.ask-error p { margin: 10px 0 0; font-weight: 600; }
.ask a { font-weight: 600; text-underline-offset: 3px; }
.ask-notice { margin: 10px 0 0; font-size: 13px; }

/* The pixel tile before a button label: one CSS pixel per art pixel, so it stays crisp. */
.links a img { flex: none; width: 20px; height: 20px; margin-right: 8px; image-rendering: pixelated; }
.links a:focus-visible, .btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.links a:hover, .btn:hover { text-decoration: underline; }
.links a:active, .btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--shadow); }

/* ---------- Right now ---------- */
.menu { list-style: none; margin: 4px 0 0; padding: 0; }
.menu > li { display: flex; align-items: center; gap: 10px; border-bottom: 2px dotted var(--soft); }
.menu > li:last-child { border-bottom: 0; }
.menu .row {
  flex: 1; min-width: 0;
  display: flex; gap: 12px; align-items: center;
  min-height: 64px;
  padding: 10px 0;
  color: inherit;
  text-decoration: none;
}
a.row:hover .t { text-decoration: underline; }
.th {
  flex: none;
  width: 46px; height: 46px;
  object-fit: cover;
  background: var(--soft);
  border: 3px solid var(--line);
}
.th.tall { height: 66px; }
/* The latest post's cover, bigger than a Lately thumbnail so a screenshot stays readable. */
.th.shot { width: 96px; height: 96px; object-fit: contain; }
.stv {
  flex: none;
  display: grid; place-items: center;
  width: 46px; height: 46px;
  font-size: 22px;
  background: var(--soft);
  border: 3px solid var(--line);
}
.menu .body { flex: 1; min-width: 0; font-size: 14px; line-height: 1.45; }
.menu .t { display: block; font-size: 15px; font-weight: 700; }
.k { display: block; margin-bottom: 4px; font-size: 12px; line-height: 1.5; }
[data-field=artist] { display: block; }
.review { display: block; margin-top: 2px; }
.go {
  flex: none;
  display: grid; place-items: center;
  width: 44px; height: 44px;
  border: 2px solid var(--line);
  border-radius: 50%;
}
/* Each icon is a 20x20 pixel app tile (tools/pixel_icons.py), framed like the avatar. */
.go { border-radius: 0; overflow: hidden; }
.go img { width: 100%; height: 100%; display: block; image-rendering: pixelated; }

.badge {
  display: inline-block;
  margin-left: 4px;
  padding: 3px 5px;
  font-size: 12px;
  line-height: 1.2;
  vertical-align: middle;
  color: #08130a;
  background: var(--hp);
}
/* Music bars next to ON while a song plays. */
#spotify-row[data-playing=true] .badge::after {
  content: "";
  display: inline-block;
  width: 9px; height: 8px;
  margin-left: 4px;
  vertical-align: bottom;
  background:
    linear-gradient(currentColor, currentColor) 0 100% / 2px 40% no-repeat,
    linear-gradient(currentColor, currentColor) 3.5px 100% / 2px 100% no-repeat,
    linear-gradient(currentColor, currentColor) 7px 100% / 2px 60% no-repeat;
  animation: bars .9s steps(1) infinite;
}
@keyframes bars {
  0% { background-size: 2px 40%, 2px 100%, 2px 60%; }
  33% { background-size: 2px 100%, 2px 50%, 2px 90%; }
  66% { background-size: 2px 70%, 2px 80%, 2px 30%; }
}

/* Reading progress as an HP bar; the ink edge marks the page even where the fill is pale. */
.hp { max-width: 160px; height: 10px; margin-top: 6px; background: var(--box); border: 2px solid var(--line); }
.hp i { display: block; height: 100%; background: var(--hp); border-right: 2px solid var(--ink); }

/* Strava's own wording, bold; Strava orange where it reads well, a darker underlined orange elsewhere. */
.strava-link {
  display: flex; align-items: center;
  width: fit-content;
  min-height: 44px;
  font-weight: 700;
  color: var(--strava);
  text-decoration-line: var(--strava-decoration);
  text-underline-offset: 3px;
}
.strava-link:hover { text-decoration-line: underline; }

/* ---------- My party ---------- */
.party { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.mon {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  background: var(--box);
  border: 3px solid var(--line);
  border-radius: 5px;
  text-decoration: none;
}
.mon .pic { position: relative; display: grid; place-items: center; height: 96px; background: var(--soft); }
.mon .pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mon .emoji { font-size: 32px; }
.mon .lv {
  position: absolute; top: 6px; left: 6px;
  padding: 3px 4px;
  font-size: 12px;
  color: var(--ink);
  background: var(--box);
  border: 2px solid var(--line);
}
.mon .n { padding: 8px 9px 10px; font-size: 13px; line-height: 1.4; }
.mon .n b { display: block; margin-bottom: 2px; font-size: 14px; }
a.mon:hover b { text-decoration: underline; }

/* ---------- PC box ---------- */
.pc .repo { display: flex; align-items: center; gap: 10px; border-bottom: 2px dotted var(--soft); }
.pc .repo > :first-child {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; justify-content: center; gap: 2px;
  min-height: 44px;
  padding: 10px 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}
.pc .repo > :first-child > span { font-size: 13px; font-weight: 400; color: var(--ink); }
.pc .repo > a:first-child:hover { text-decoration: underline; }
.pc .try, .pc .more {
  display: inline-flex; align-items: center;
  min-height: 44px;
  font-weight: 700;
  text-decoration: none;
}
.pc .try { flex: none; min-width: 44px; font-size: 14px; color: var(--accent); white-space: nowrap; }
.pc .more { display: flex; padding: 0; font-size: 15px; color: var(--ink); }
.pc .try:hover, .pc .more:hover { text-decoration: underline; }
.pc > :last-child { border-bottom: 0; }
/* What kind of project a row is (AI, data, uni...), as a small outlined chip after its name. */
.pc .tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 5px;
  font-size: 11px; font-weight: 700; line-height: 1.4;
  text-transform: uppercase; letter-spacing: .04em;
  vertical-align: 2px;
  border: 2px solid var(--line);
  border-radius: 3px;
}

/* ---------- footer ---------- */
.foot { margin: 8px 0 0; font-size: 13px; line-height: 1.7; text-align: center; color: var(--ink-on-bg); }
.foot a { color: var(--ink-on-bg); }

/* ---------- case-study pages ---------- */
article { font-size: 16px; line-height: 1.6; }
article h1, article h2 { font-family: "Press Start 2P", ui-monospace, monospace; font-weight: 400; line-height: 1.6; overflow-wrap: anywhere; }
article h1 { margin: 4px 0 10px; font-size: 16px; }
article h2 { margin: 26px 0 8px; font-size: 12px; }
article h3 { margin: 20px 0 6px; font-size: 17px; }
article .meta { margin: 0 0 12px; font-size: 14px; font-weight: 600; }
article a:not(.btn) { font-weight: 600; text-underline-offset: 3px; }
article img { display: block; height: auto; border: 3px solid var(--line); }
article figure { margin: 14px 0; }
article pre, article table { display: block; max-width: 100%; overflow-x: auto; }
article pre { padding: 10px; background: var(--soft); }
article code { font-family: ui-monospace, Consolas, monospace; font-size: .9em; }
.embed { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin: 16px 0; }
.embed small { font-size: 14px; line-height: 1.5; }
.embed iframe { display: block; width: 100%; height: 760px; background: #fff; border: 3px solid var(--line); }
button.btn { font-family: Inter, system-ui, sans-serif; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .links a:active, .btn:active { transform: none; }
  .ask-cursor { animation: none; }
}

/* ---------- Studying now ---------- */
.study { list-style: none; margin: 10px 0 0; padding: 0; }
.study li { padding: 6px 0 8px; }
.tree .row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 14px; line-height: 1.4; }
.tree .pct { flex: none; font-weight: 700; font-variant-numeric: tabular-nums; }
.tree .bar { height: 14px; margin-top: 4px; background: var(--soft); border: 3px solid var(--line); border-radius: 4px; overflow: hidden; }
.tree .bar i { display: block; height: 100%; background: var(--accent); }
.tree > summary { display: block; margin-top: 10px; padding: 10px; background: var(--soft); border: 3px solid var(--line); border-radius: 5px; cursor: pointer; list-style: none; }
.tree > summary::-webkit-details-marker, .topic > summary::-webkit-details-marker { display: none; }
.tree > summary:hover { border-color: var(--accent); }
.tree > summary:focus-visible, .topic > summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.tree .now { display: inline-block; margin-bottom: 4px; padding: 1px 6px; font-size: 11px; font-weight: 700; color: var(--box); background: var(--accent); border-radius: 3px; }
.tree .path { margin-left: 8px; font-size: 12px; font-weight: 700; }
.tree .all { display: block; margin-top: 6px; font-size: 13px; font-weight: 700; color: var(--accent); }
.tree[open] .all { visibility: hidden; height: 0; margin: 0; }
.tree .bar { background: var(--box); }
.study { margin-top: 8px; }
/* The tree map (inline SVG from render._study_map): palette variables, so both themes work. */
.smap { display: block; width: 100%; max-width: 400px; height: auto; margin: 10px 0 0; overflow: visible; }
.smap path { fill: none; stroke: var(--line); stroke-width: 2; }
.smap .gbox { fill: var(--soft); stroke: var(--line); stroke-width: 2; }
.smap .sq { fill: var(--box); stroke: var(--line); stroke-width: 3; }
.smap .fl { fill: var(--accent); }
.smap .hit { fill: transparent; }
.smap .ring { fill: none; stroke: var(--accent); stroke-width: 2; }
.smap text { fill: var(--ink); font: 700 11px/1 Inter, system-ui, sans-serif; text-anchor: middle; }
.smap .now text { fill: var(--accent); }
.smap .sn { cursor: pointer; }
.smap .sn:hover .sq { stroke: var(--accent); }
.smap .sn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.tree .gh { margin: 14px 0 0; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.subs { list-style: none; margin: 4px 0 8px; padding: 0 0 0 10px; border-left: 3px solid var(--line); }
.subs > li { padding: 0; }
.sub > summary { display: flex; align-items: center; min-height: 44px; padding: 5px 0; font-size: 13px; font-weight: 600; cursor: pointer; list-style: none; }
.sub > summary .row { flex: 1; }
.sub > summary::-webkit-details-marker { display: none; }
.sub > summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.topic > summary { display: block; padding: 4px 0; cursor: pointer; list-style: none; }
.items { list-style: none; margin: 4px 0 6px; padding: 0 0 0 12px; border-left: 3px solid var(--line); font-size: 13px; line-height: 1.4; }
.items .item { display: flex; gap: 8px; align-items: baseline; padding: 2px 0; }
.items .item > span:nth-child(2) { flex: 1; min-width: 0; }
.items .mark { width: 1em; text-align: center; color: var(--accent); }
.items .done > span:nth-child(2) { text-decoration: line-through; opacity: .7; }
.study .bar { background: var(--soft); }
