@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("assets/fonts/GeistMono-Variable.woff2") format("woff2");
}
:root {
  color-scheme: light;
  --bg: #ebe4d6;
  --text: #2b2620;
  --strong: #17130f;
  --muted: #6b6256;
  --faint: #9a907f;
  --line: #ddd4c3;
  --edge: #c4b9a4;
  --link: #1f4e9c;
  --hover: #efe7d6;
  --serif: "Linux Libertine", "Georgia", "Times New Roman", serif;
  /* Frosted cream glass: warm enough to rest the eyes, blurred enough that the ASCII turns to haze. */
  --glass: linear-gradient(180deg, #fffaf0ed, #f8f1e2d9);
  --glass-blur: blur(14px) saturate(120%);
  --glass-shine: inset 0 1px 0 #fff;
  --tile: #f6efe1;
  --ease: .2s ease-out;
  font-family: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100svh; padding: 32px 24px; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
a:hover, button:hover { color: var(--strong); }
:focus-visible { outline: 1px solid var(--strong); outline-offset: 3px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Background: canvas-drawn ASCII mountains (backdrop.js) in grey ink on pale paper. */
.backdrop { position: fixed; inset: 0; z-index: -1; display: block; width: 100%; height: 100%; background: linear-gradient(180deg, #f3ede1, #e2d9c7); }

/* Window */
.portfolio { position: relative; display: flex; flex-direction: column; width: min(100%, 1280px); min-height: calc(100svh - 64px); margin: 0 auto; padding: 30px 44px 22px; background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); border: 1px solid var(--edge); box-shadow: var(--glass-shine), 0 24px 60px #3a2f1f33; }

.portfolio > * { flex-shrink: 0; }

/* Header: name left, plain text nav right */
header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px 24px; margin-bottom: 26px; padding-bottom: 10px; border-bottom: 1px solid var(--edge); }
.identity-title { margin: 0; font: 400 1.6rem/1.2 var(--serif); }
.identity { white-space: nowrap; color: var(--strong); }
header nav { display: flex; flex-wrap: wrap; gap: 20px; }
header nav a { padding-bottom: 2px; border-bottom: 1px solid transparent; color: var(--link); transition: color var(--ease), border-color var(--ease); }
header nav a:hover { color: var(--link); border-color: var(--link); }
header nav a.active { color: var(--strong); border-color: var(--strong); }
.theme-toggle { padding: 0 0 2px; border: 0; border-bottom: 1px dashed var(--faint); background: none; font: inherit; color: var(--muted); }
.theme-toggle:hover { color: var(--strong); border-bottom-color: var(--strong); }

/* Landing lists */
section { scroll-margin-top: 24px; }
.landing-grid { display: grid; grid-template-columns: 400px minmax(0, 1fr); align-items: stretch; }
.landing-side { padding-right: 40px; }
.landing-main { padding-left: 40px; border-left: 1px solid var(--line); }
.landing-side > * + *, .landing-main > * + * { margin-top: 22px; }
.portrait { position: relative; display: grid; place-items: center; overflow: hidden; width: 170px; aspect-ratio: 1; border: 1px solid var(--edge); background: var(--tile); box-shadow: var(--glass-shine); }
.portrait-initials { font: 400 2.2rem/1 var(--serif); color: var(--muted); }
.portrait img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bio { max-width: 70ch; margin: 0; font: 1.15rem/1.6 var(--serif); color: var(--strong); text-wrap: pretty; }

/* Favorites column */
.fav { display: flex; align-items: center; gap: 14px; color: var(--text); }
.fav + .fav { margin-top: 10px; }
.fav img { flex: none; width: 52px; height: 52px; object-fit: cover; box-shadow: 0 0 0 1px var(--line); }
.fav img.book { width: 29px; margin-inline: 11px; }
.fav > span { display: grid; }
.fav strong { font-weight: 600; color: var(--strong); }
.fav .muted { font-size: 12px; }
a.fav strong { color: var(--link); }
a.fav:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.muted { color: var(--muted); }
.section-label, .detail-label { margin: 0 0 8px; font: italic 400 1.15rem/1.3 var(--serif); color: var(--muted); }
.arrow-list { margin: 0; padding: 0; list-style: none; }
.arrow-list li { display: flex; gap: 8px; }
.arrow-list li + li { margin-top: 6px; }
.arrow-list strong { font-weight: 600; color: var(--strong); }
.text-link strong { color: var(--link); }
.text-link:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.entry-mark { flex: none; color: var(--faint); }
.inline-logo { display: inline-block; width: 16px; height: 16px; margin: 0 2px; object-fit: cover; vertical-align: -3px; }
.inline-logo.wide { width: 22px; height: 14px; object-fit: contain; vertical-align: -2px; }
.inline-logo.book { width: 10px; }
.logo-mark { flex: none; position: relative; display: inline-grid; place-items: center; width: 15px; height: 15px; overflow: hidden; vertical-align: -3px; }
.uta-mark { background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.uta-fallback { font-size: 9px; font-weight: 700; color: #111; }
.uta-logo { position: absolute; inset: 0; width: 100%; height: 100%; padding: 1px; object-fit: contain; }
.fact-title { color: var(--strong); }
.fact-sub { display: flex; align-items: flex-start; gap: 8px; margin-top: 4px; color: var(--muted); }

.button-link { display: block; padding: 12px; border: 1px solid var(--edge); background: var(--tile); text-align: center; color: var(--strong); transition: border-color var(--ease), background var(--ease); }
.button-link:hover { border-color: var(--muted); background: var(--hover); }

/* Project cards (projects page) */
.project-card { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); background: var(--tile); color: var(--text); text-align: left; transition: border-color var(--ease), background var(--ease); }
a.project-card:hover { border-color: var(--edge); background: #fff; color: var(--text); }
.card-media, .dialog-media { position: relative; aspect-ratio: 2.2 / 1; overflow: hidden; background: #000; border-bottom: 1px solid var(--line); }
.card-media .media-art, .dialog-media .media-art { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
a.project-card:hover .card-media .media-art { transform: scale(1.02); }
.card-badge { display: inline-block; padding: 2px 8px; border: 1px solid var(--edge); background: #fffe; font-size: 11px; color: var(--text); }
.card-media .card-badge, .dialog-media .card-badge { position: absolute; left: 12px; top: 12px; }
.media-mark { position: absolute; right: 8px; bottom: 8px; width: 13%; height: auto; pointer-events: none; }
.dialog-media .media-mark { right: 14px; bottom: 12px; }
.dialog-media .card-badge { left: 16px; top: 16px; }
.card-body { display: flex; flex: 1; flex-direction: column; padding: 14px 16px; }
.card-status { align-self: flex-start; margin-bottom: 6px; padding: 0 6px; border: 1px solid currentColor; font-size: 11px; letter-spacing: .04em; }
.status-ongoing { color: #2f7d46; }
.status-deprecated { color: #9a3b2e; }
.card-title { margin: 0 0 4px; font: 400 1.2rem/1.3 var(--serif); color: var(--link); }
.card-summary { margin: 0; color: var(--muted); }
.card-more { margin-top: auto; padding-top: 12px; font-size: 12px; color: var(--faint); transition: color var(--ease); }
a.project-card:hover .card-title { text-decoration: underline; text-underline-offset: 3px; }
a.project-card:hover .card-more { color: var(--link); }
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 14px; }
.research-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; font-size: 11px; color: var(--muted); }
.research-tags span { padding: 1px 7px; border: 1px solid var(--line); }

/* Detail dialogs (projects, blog posts) */
.project-dialog { width: min(100% - 24px, 720px); max-height: min(100% - 48px, 900px); padding: 0; border: 1px solid var(--edge); background: #fff; box-shadow: 0 24px 60px #3a2f1f40; color: var(--text); font: inherit; overscroll-behavior: contain; }
.project-dialog::backdrop { background: #3a2f1f4d; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.project-dialog[open] { animation: rise .25s ease-out; }
.dialog-close { position: sticky; z-index: 1; top: 12px; float: right; display: grid; place-items: center; width: 32px; height: 32px; margin: 12px 12px -44px 0; border: 1px solid var(--edge); background: var(--tile); font-size: 18px; line-height: 1; color: var(--text); }
.dialog-close:hover { border-color: var(--muted); }
#dialog-body > :not(.dialog-media, .wiki) { margin-inline: 28px; }
.dialog-head { display: block; margin-top: 24px; }
.dialog-title { margin: 0 0 6px; font-size: 1.1rem; font-weight: 600; color: var(--strong); }
.detail-section { margin-top: 24px; }
.detail-label { margin-bottom: 8px; }
.detail-text { margin: 0; }
.detail-list { margin: 0; padding: 0; list-style: none; }
.detail-list li { display: flex; gap: 8px; }
.detail-list li + li { margin-top: 6px; }
#dialog-body > .button-link { margin-top: 28px; margin-bottom: 28px; }
#dialog-body > :last-child:not(.button-link, .wiki) { margin-bottom: 28px; }

/* Project details: white, retro encyclopedia article */
.wiki-dialog { border: 1px solid var(--edge); background: #fffcf5; box-shadow: 0 30px 80px #3a2f1f4d; color: var(--text); }
.wiki-dialog .dialog-close { border-color: var(--edge); background: var(--tile); color: var(--text); }
.wiki-dialog .dialog-close:hover { border-color: var(--muted); color: var(--strong); }
#dialog-body > .wiki { margin: 0; }
.wiki { padding: 26px 32px 30px; font: 14px/1.6 Arial, "Helvetica Neue", Helvetica, sans-serif; }
.wiki::after { content: ""; display: block; clear: both; }
.wiki-title { color: var(--strong) !important; margin: 0 44px 0 0; padding-bottom: 4px; border-bottom: 1px solid var(--edge); font: 400 1.9rem/1.3 "Linux Libertine", Georgia, "Times New Roman", serif; color: #000; }
.wiki-tagline { margin: 6px 0 16px; font-size: 12.5px; color: var(--muted); }
.wiki-lead { margin: 0 0 12px; }
.wiki-notice { margin: 0 0 14px; padding: 8px 12px; border: 1px solid var(--edge); border-left: 6px solid var(--edge); background: var(--tile); font-size: 13px; }
.notice-deprecated { border-left-color: #9a3b2e; }
.notice-ongoing { border-left-color: #2f7d46; }
.wiki p { margin: 0 0 12px; }
.wiki a { color: var(--link); }
.wiki a:hover { color: var(--link); text-decoration: underline; }
.wiki-heading { clear: none; margin: 22px 0 8px; padding-bottom: 3px; border-bottom: 1px solid var(--edge); font: 400 1.45rem/1.3 "Linux Libertine", Georgia, "Times New Roman", serif; color: var(--strong); }
.wiki ul { margin: 0 0 12px; padding-left: 22px; list-style: square; }
.wiki li + li { margin-top: 4px; }
.wiki-infobox { float: right; width: 280px; margin: 4px 0 14px 20px; border: 1px solid var(--edge); border-spacing: 3px; background: var(--tile); font-size: 12.5px; line-height: 1.45; }
.wiki-infobox caption { padding: 6px 4px; font-weight: 700; font-size: 14px; color: var(--strong); }
.wiki-infobox img { display: block; width: 100%; height: auto; border: 1px solid var(--line); }
.wiki-infobox th { width: 38%; padding: 4px 6px; vertical-align: top; text-align: left; }
.wiki-infobox td { padding: 4px 6px; vertical-align: top; }
.wiki-infobox ul { margin: 0; padding-left: 16px; list-style: disc; }
.wiki-infobox li + li { margin-top: 0; }
.wiki-categories { clear: both; margin: 24px 0 0 !important; padding: 6px 10px; border: 1px solid var(--edge); background: var(--tile); font-size: 12.5px; color: var(--muted); }

/* Projects page */
#projects { min-height: 200px; }
.projects-empty { padding: 16px 0 32px; color: var(--muted); }
.projects-empty p { margin: 0; }

/* Experience: a ruled list, period on the left */
.experience-list { margin: 0; padding: 0; list-style: none; }
.experience-entry { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 2px 20px; padding: 12px 0; }
.experience-entry:first-child { padding-top: 0; }
.experience-entry.group-start:not(:first-child) { margin-top: 10px; padding-top: 22px; border-top: 1px solid var(--line); }
.experience-period { grid-row: 1 / span 2; padding-top: 1px; font-size: 12px; font-style: italic; color: var(--faint); }
.experience-role { margin: 0; font-size: 1rem; font-weight: 700; color: var(--strong); }
.experience-org { font-weight: 400; color: var(--muted); }
.experience-entry > :not(.experience-period) { grid-column: 2; }
.experience-entry .detail-list { margin-top: 10px; }

/* Blog */
.post-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.post-entry { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 2px 20px; padding: 16px 0; border-bottom: 1px solid var(--line); color: var(--text); }
.post-entry:hover { color: var(--text); }
.post-entry:hover .post-title { text-decoration: underline; text-underline-offset: 3px; }
.post-entry .post-date { grid-row: 1 / span 2; padding-top: 1px; }
.post-entry > :not(.post-date) { grid-column: 2; }
.post-date { margin: 0; font-size: 12px; color: var(--faint); }
.post-title { margin: 0; font: 400 1.2rem/1.3 var(--serif); color: var(--link); }
.posts-empty { margin: 0; color: var(--muted); }
#post-body { margin: 28px; }
#post-body .dialog-title { margin-bottom: 16px; }
#post-body .detail-text + .detail-text { margin-top: 12px; }

/* Welcome prompt */
.welcome { padding: 32px 28px 26px; border: 1px solid var(--edge); background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: var(--glass-shine), 0 24px 60px #3a2f1f3d; color: var(--text); font: inherit; text-align: center; }
.welcome::backdrop { background: #3a2f1f33; -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.welcome[open] { animation: rise .35s ease-out; }
.welcome-name { margin: 0 0 22px; font: 400 1.6rem/1.2 var(--serif); color: var(--strong); }
.welcome-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.welcome-choice { display: flex; align-items: center; justify-content: center; gap: 10px; min-width: 190px; padding: 12px 16px; border: 1px solid var(--edge); background: var(--tile); color: var(--strong); transition: background var(--ease), border-color var(--ease); }
.welcome-choice:hover { border-color: var(--muted); background: var(--hover); }

/* Footer: icon links over the copyright */
/* Pinned to the bottom so every tab's window is the same height. */
footer { margin-top: auto; font-size: 12px; color: var(--muted); }
footer::before { content: ""; display: block; margin: 28px 0 14px; border-top: 1px solid var(--line); }
.social-links { display: flex; gap: 14px; margin-bottom: 6px; }
.social-links a { display: grid; place-items: center; color: var(--muted); }
.social-links a:hover { color: var(--link); }

.skip-link { position: fixed; top: 10px; left: 10px; padding: 8px 12px; background: var(--bg); z-index: 11; transform: translateY(-160%); }
.skip-link:focus { transform: none; }

/* Dark mode: the black glossy theme (smoked glass, white ink, monospace throughout). */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000;
  --text: #ffffffcc;
  --strong: #fff;
  --muted: #ffffff8c;
  --faint: #ffffff52;
  --line: #ffffff1a;
  --edge: #ffffff26;
  --link: #c3d0ff;
  --hover: #ffffff0d;
  --serif: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --glass: linear-gradient(180deg, #ffffff0a, #ffffff03 35%), #0a0a0acc;
  --glass-blur: blur(22px) saturate(140%);
  --glass-shine: inset 0 1px 0 #ffffff17;
  --tile: #ffffff06;
}
[data-theme="dark"] .backdrop { background: #000; }
[data-theme="dark"] .portfolio, [data-theme="dark"] .welcome { box-shadow: var(--glass-shine), 0 30px 80px #000c; }
[data-theme="dark"] .identity-title { font: 700 1rem/1.4 var(--serif); }
[data-theme="dark"] .bio { font-size: 1.05rem; }
[data-theme="dark"] .card-title { font: 600 1rem/1.4 var(--serif); color: var(--strong); }
[data-theme="dark"] a.project-card:hover { background: #ffffff0a; }
[data-theme="dark"] .card-badge { background: #000c; }
[data-theme="dark"] .project-dialog, [data-theme="dark"] .wiki-dialog { background: #0b0b0bf7; box-shadow: var(--glass-shine), 0 30px 80px #000c; }
[data-theme="dark"] .project-dialog::backdrop { background: #000b; }
[data-theme="dark"] .welcome::backdrop { background: #0006; }
[data-theme="dark"] .status-ongoing { color: #7fd69a; }
[data-theme="dark"] .status-deprecated { color: #f0917f; }
[data-theme="dark"] .notice-ongoing { border-left-color: #7fd69a; }
[data-theme="dark"] .notice-deprecated { border-left-color: #f0917f; }

@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.portfolio { animation: rise .45s ease-out both; }

@media (max-width: 760px) {
  body { padding: 12px 10px; }
  .portfolio { padding: 26px 20px 20px; }
  header { margin-bottom: 30px; }
  header nav { gap: 16px; }
  .landing-grid { grid-template-columns: minmax(0, 1fr); }
  .landing-side { padding: 0 0 28px; }
  .landing-main { padding: 28px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .portrait { width: 150px; }
  .welcome-actions { grid-template-columns: minmax(0, 1fr); }
  .welcome-choice { min-width: 0; }
  .experience-entry, .post-entry { grid-template-columns: minmax(0, 1fr); }
  .experience-period, .post-entry .post-date { grid-row: auto; padding: 0; }
  .experience-period:empty { display: none; }
  .experience-entry > :not(.experience-period), .post-entry > :not(.post-date) { grid-column: 1; }
  #dialog-body > :not(.dialog-media, .wiki) { margin-inline: 18px; }
  .portfolio { min-height: calc(100svh - 24px); }
  .wiki { padding: 20px 18px 24px; }
  .wiki-infobox { float: none; width: 100%; margin: 0 0 16px; }
}
@media (prefers-reduced-motion: reduce) {
  :root { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  a.project-card:hover .card-media .media-art { transform: none; }
}
