@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;700&display=swap");

:root {
  color-scheme: light;
  --ink: #101010;
  --paper: #fffafa;
  --wall: #fbe6f0;
  --pink: #f4b6d2;
  --mint: #c9e9c0;
  --ui-font: "Cascadia Mono", "IBM Plex Mono", monospace;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #ffffff;
  --paper: #181818;
  --wall: #101010;
  --pink: #61384b;
  --mint: #385b42;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  color: var(--ink);
  background: var(--paper);
  font: 1rem/1.5 var(--ui-font);
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px dashed currentColor; outline-offset: 2px; }
.system-bar, .taskbar {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .45rem .75rem;
  background: var(--paper);
}
.system-bar { border-bottom: 2px solid var(--ink); }
.system-name { margin-right: auto; font: 700 1rem var(--ui-font); }
.system-name span { margin-right: .25rem; }
.system-bar button, .taskbar button, .window-controls button {
  padding: .24rem .55rem;
  border: 1px solid var(--ink);
  background: var(--paper);
}
.desktop {
  isolation: isolate;
  position: relative;
  overflow: hidden;
  background: var(--wall);
}
.launchers { display: grid; justify-items: center; gap: .5rem; width: 7rem; padding-top: 1.25rem; }
.launchers { position: relative; z-index: 1; max-height: 100%; overflow: auto; }
.desktop-profile { position: absolute; inset: 1.2rem 1.5rem auto 8.25rem; max-width: 42rem; }
.desktop-profile h1 { margin: .1rem 0; font: 700 clamp(2rem, 5vw, 4rem)/1 var(--ui-font); }
.desktop-profile h1 span { color: var(--mint); text-shadow: 1px 1px var(--ink); }
.desktop-profile p { margin: .35rem 0; }
.launchers button {
  display: grid;
  justify-items: center;
  gap: .5rem;
  min-width: 5.5rem;
  min-height: 4.5rem;
  padding: .6rem .3rem;
  border: 1px solid transparent;
  background: transparent;
  user-select: none;
}
.launchers button:hover, .launchers button.is-selected { border-color: var(--ink); background: var(--mint); }
.desktop-icon {
  position: relative;
  width: 2.1rem;
  height: 1.45rem;
  margin-top: .3rem;
  border: 2px solid var(--ink);
  background: var(--mint);
}
.desktop-icon::before {
  content: "";
  position: absolute;
  inset: -.4rem auto auto -2px;
  width: 1rem;
  height: .4rem;
  border: 2px solid var(--ink);
  border-bottom: 0;
  background: var(--mint);
}
.desktop-icon.document-icon { width: 1.45rem; height: 1.85rem; background: var(--paper); }
.desktop-icon.document-icon::before { inset: .4rem .2rem; width: auto; height: .65rem; border: 0; border-block: 2px solid var(--ink); background: transparent; }
.desktop-hint { position: absolute; bottom: .65rem; left: .75rem; font-size: .7rem; }
.app-window {
  position: absolute;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 2px solid var(--ink);
  background: var(--paper);
  overflow: hidden;
}
.app-window:focus { outline: 0; }
.app-window:focus-visible .title-bar { outline: 2px dashed var(--ink); outline-offset: -4px; }
.title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .4rem;
  padding: .3rem .45rem;
  min-height: 2.6rem;
  background: var(--mint);
  border-bottom: 1px solid var(--ink);
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.app-window.is-active .title-bar { background: var(--pink); }
.title-bar h2 { margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .88rem; }
.window-controls { display: flex; gap: .2rem; }
.window-controls button { width: 1.75rem; height: 1.75rem; padding: 0; line-height: 1; }
.window-content { overflow: auto; min-height: 0; }
.resize-grip {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 18px;
  height: 18px;
  border-top: 1px solid var(--ink);
  border-left: 1px solid var(--ink);
  background: repeating-linear-gradient(135deg, var(--paper) 0 3px, var(--mint) 3px 6px);
  cursor: nwse-resize;
  touch-action: none;
}
.is-maximized .resize-grip { display: none; }
.taskbar { border-top: 2px solid var(--ink); }
#tasks { display: flex; gap: .4rem; min-width: 0; overflow: auto; padding: 2px; }
#tasks button { flex: 0 0 auto; max-width: 13rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#tasks button[aria-pressed="true"] { background: var(--mint); }
.explorer { padding: 1rem; }
.explorer h3 { margin: 0 0 .75rem; font: 700 1.25rem var(--ui-font); }
.explorer-layout { display: grid; grid-template-columns: minmax(8rem, 1fr) minmax(0, 3fr); gap: 1rem; }
.filters { display: grid; align-content: start; gap: .65rem; padding: .65rem; background: var(--mint); }
.featured-header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem; margin-bottom: .75rem; }
.featured-header button { border: 1px solid var(--ink); padding: .35rem .55rem; background: var(--mint); }
.featured { container-type: inline-size; }
.file-list.featured-files { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@container (max-width: 41rem) {
  .file-list.featured-files { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container (max-width: 19rem) {
  .file-list.featured-files { grid-template-columns: 1fr; }
}
.project-file p { margin: 0; font-size: .78rem; }
.os-document {
  container-type: inline-size;
  max-width: 60rem;
  margin-inline: auto;
  padding: clamp(1rem, 4%, 2rem);
  overflow-wrap: anywhere;
}
.os-document h3 { font: 700 clamp(1.5rem, 6cqw, 2.5rem)/1.1 var(--ui-font); margin: 0 0 .65rem; }
.os-document h4, .os-document h5 { font-size: 1rem; margin: 0 0 .5rem; }
.os-document p { max-width: 70ch; }
.os-document img, .os-document video { display: block; max-width: 100%; height: auto; }
.os-document video { width: min(100%, 45rem); }
.os-document a { text-underline-offset: .2em; }
.os-document a:hover { background: var(--mint); }
.document-section, .cv-section { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px dashed var(--ink); }
.document-links, .cv-contact { display: flex; align-items: baseline; flex-wrap: wrap; gap: .5rem; }
.document-links > :is(a, button) { display: inline-block; border: 1px solid var(--ink); background: var(--mint); padding: .2rem .45rem; text-decoration: underline; text-underline-offset: .2em; }
.document-links > :is(a, button):hover { background: var(--pink); }
.contact-status { margin: .5rem 0 0; font-size: .85rem; }
.contact-status:empty { margin: 0; }
.contact-address { width: min(100%, 27ch); margin-top: .35rem; padding: .25rem .45rem; background: var(--paper); border: 1px solid var(--ink); }
.crafting-stage { display: grid; grid-template-columns: minmax(0, 20rem) minmax(1rem, 4rem) minmax(0, 10rem); align-items: center; gap: clamp(.35rem, 2cqw, 1rem); margin: .75rem 0 0; }
.crafting-board { position: relative; }
.crafting-base, .crafting-result { width: 100%; }
.crafting-arrow { image-rendering: pixelated; }
.crafting-item { position: absolute; inset: var(--y) auto auto var(--x); width: var(--size); transform: translate(-50%, -50%); }
.crafting-board .crafting-item:hover { background: transparent; }
.crafting-item span { position: absolute; left: 50%; bottom: 100%; transform: translateX(-50%); padding: .12rem .3rem; border: 1px solid var(--ink); background: var(--paper); font-size: .7rem; white-space: nowrap; pointer-events: none; opacity: 0; }
.crafting-item:is(:hover, :focus-visible) { z-index: 1; }
.crafting-item:is(:hover, :focus-visible) span { opacity: 1; }
.crafting-item[data-material="installation"] { --x: 50%; --y: 18%; --size: 26%; }
.crafting-item[data-material="film"] { --x: 18.5%; --y: 49%; --size: 23%; }
.crafting-item[data-material="video-game"] { --x: 50%; --y: 49%; --size: 22%; }
.crafting-item[data-material="photography"] { --x: 81.5%; --y: 49%; --size: 16%; }
.crafting-item[data-material="mixed-media"] { --x: 50%; --y: 81.5%; --size: 24%; }
.project-gallery { display: grid; gap: .65rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); }
.project-gallery img { width: 100%; aspect-ratio: 3 / 2; object-fit: contain; background: var(--wall); }
.project-gallery a { border: 1px solid var(--ink); }
.project-credits { display: grid; grid-template-columns: max-content 1fr; gap: .4rem .8rem; }
.project-credits dd { margin: 0; }
.project-document li + li { margin-top: .35rem; }
.cv-section { display: grid; grid-template-columns: minmax(8rem, 1fr) minmax(0, 3fr); gap: .5rem 1.25rem; }
.cv-section > p, .cv-entry p { margin: 0 0 .4rem; }
.cv-entry + .cv-entry { margin-top: 1rem; }
.cv-entry .label { display: inline-block; margin-bottom: .35rem; background: var(--mint); padding: .05rem .35rem; font-size: .72rem; }
.cv-meta, .cv-role { font-size: .85rem; }
.note-list { list-style: none; padding: 0; }
.note-list li { display: flex; align-items: baseline; flex-wrap: wrap; gap: .45rem 1rem; border-top: 1px dashed var(--ink); padding: .55rem 0; }
.note-list button { border: 1px solid var(--ink); background: var(--mint); padding: .25rem .55rem; text-align: left; }
.note-list button:hover { background: var(--pink); }
.note-entry { white-space: pre-wrap; }
@container (max-width: 34rem) {
  .cv-section { grid-template-columns: 1fr; }
  .crafting-stage { grid-template-columns: minmax(0, 4fr) minmax(.8rem, .6fr) minmax(0, 1.8fr); }
}
.filters label { display: grid; gap: .25rem; max-width: 100%; }
.filters input, .filters select { max-width: 100%; border: 1px solid var(--ink); padding: .3rem; background: var(--paper); }
.file-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 9rem), 1fr)); gap: .65rem; }
.project-file { display: grid; align-content: start; gap: .3rem; padding: .4rem; border: 1px solid var(--ink); background: var(--paper); text-align: left; }
.project-file:hover { background: var(--mint); }
.project-file img { width: 100%; aspect-ratio: 3 / 2; object-fit: contain; background: var(--wall); }
.project-file img, .crafting-item img, .crafting-result, .crafting-arrow { filter: url(#thumbnail-palette); }
.project-file:hover img, .project-file:focus-visible img, .crafting-item:is(:hover, :focus-visible) img { filter: none; }
.project-file small { font-size: .68rem; }
.image-filters { position: absolute; pointer-events: none; }
@media (max-width: 640px), (pointer: coarse) {
  .desktop-profile { position: static; padding: 1rem; }
  .launchers { width: auto; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: .5rem; }
  .launchers button { min-width: 0; min-height: 3.25rem; font-size: .72rem; }
  .explorer-layout { grid-template-columns: 1fr; }
  .filters { grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr)); }
  .system-bar { gap: .4rem; padding-inline: .45rem; font-size: .72rem; }
  .system-name { font-size: .8rem; }
  .title-bar { cursor: default; }
  .window-controls button { width: 2.6rem; height: 2.6rem; }
  .resize-grip, [data-action="maximize"], .desktop-hint { display: none; }
  .taskbar button { min-height: 2.6rem; }
}
