/* Windows 98 MS Paint look */
:root {
  --face: #c0c0c0;
  --hi: #ffffff;
  --shadow: #808080;
  --dark: #000000;
  --title1: var(--ink);
  --title2: color-mix(in srgb, var(--ink), #fff 45%);
  --ink: #657a62;
}

* { box-sizing: border-box; }

html, body { margin: 0; height: 100%; }
body {
  background: var(--face);
  font: 12px/1.4 Tahoma, "MS Sans Serif", Verdana, sans-serif;
  color: #000;
  overflow: hidden;
}

/* window fills the whole page */
.window {
  height: 100vh;
  height: 100dvh;
  background: var(--face);
  border: 2px solid;
  border-color: var(--hi) var(--dark) var(--dark) var(--hi);
  padding: 3px;
  display: flex;
  flex-direction: column;
}

.titlebar {
  background: var(--title1);
  background: linear-gradient(90deg, var(--title1), var(--title2));
  color: #fff;
  font-weight: bold;
  padding: 3px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: none;
}
.titlebar .title { display: flex; align-items: center; gap: 6px; }
.titlebar .icon { width: 14px; height: 14px; background: conic-gradient(red 0 25%, yellow 0 50%, lime 0 75%, blue 0); border: 1px solid #000; }
.controls { display: flex; gap: 2px; }
.controls button {
  width: 16px; height: 14px;
  padding: 0;
  background: var(--face);
  color: #000;
  font: bold 10px/10px Tahoma, sans-serif;
  border: 1px solid;
  border-color: var(--hi) var(--dark) var(--dark) var(--hi);
  cursor: pointer;
}
.controls button:active { border-color: var(--dark) var(--hi) var(--hi) var(--dark); }
.controls button:last-child { margin-left: 2px; }

/* menu bar = navigation */
.menubar { display: flex; flex-wrap: wrap; padding: 2px 0; flex: none; }
.menubar a, .menubar button {
  color: #000;
  text-decoration: none;
  padding: 2px 8px;
  background: none;
  border: 0;
  font: inherit;
  cursor: pointer;
}
.menubar a::first-letter, .menubar button::first-letter { text-decoration: underline; }
.menubar a:hover, .menubar a.active, .menubar button:hover { background: var(--title1); color: #fff; }
.menubar .spacer { flex: 1; }

/* body: toolbox + canvas */
.workspace { display: flex; gap: 4px; flex: 1; min-height: 0; }

.toolbox {
  width: 56px;
  flex: none;
  display: grid;
  grid-template-columns: 25px 25px;
  grid-auto-rows: 25px;
  align-content: start;
  padding: 2px;
}
.toolbox button {
  background: var(--face);
  border: 1px solid;
  border-color: var(--hi) var(--dark) var(--dark) var(--hi);
  font-size: 14px;
  padding: 0;
  cursor: pointer;
  color: #000;
}
.toolbox button.on {
  border-color: var(--dark) var(--hi) var(--hi) var(--dark);
  background: repeating-conic-gradient(#fff 0 25%, var(--face) 0 50%) 0 0 / 2px 2px;
}
.toolbox .well {
  grid-column: 1 / -1;
  grid-row: span 3;
  margin-top: 6px;
  border: 1px solid;
  border-color: var(--shadow) var(--hi) var(--hi) var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: center;
  padding: 4px 0;
}
.well span { display: block; width: 34px; background: #000; cursor: pointer; outline-offset: 2px; }
.well span.on { outline: 1px solid var(--title1); background: var(--title1); }

.canvas-frame {
  flex: 1;
  min-width: 0;
  background: #fff;
  border: 2px solid;
  border-color: var(--shadow) var(--hi) var(--hi) var(--shadow);
  overflow: auto;
}
.canvas {
  position: relative;
  background: #fff;
  padding: 36px 5vw 48px;
  font: 17px/1.65 Verdana, Tahoma, sans-serif;
  min-height: 100%;
}
/* keep lines a readable length on wide screens */
.canvas > :not(.layer) { max-width: 1200px; margin-left: auto; margin-right: auto; }
.hero { justify-content: center; }
.links, ul.tags { justify-content: center; }

/* project pictures: drop a file into images/ with the matching name */
.shot {
  display: block;
  height: 320px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  margin-bottom: 12px;
  border: 1px dashed #000;
  padding: 4px;
  background: #fff;
}
/* projects: text on the left, picture on the right; text column is the same width in every row */
.page-projects .item {
  display: grid;
  grid-template-columns: 1fr 380px;
  column-gap: 32px;
  align-items: center;
  padding-bottom: 28px;
  margin-bottom: 28px;
  border-bottom: 1px dashed #ccc;
}
.page-projects .item:last-child, .page-projects .item:has(+ h2) { border-bottom: 0; }
.page-projects .item > .info { grid-column: 1; grid-row: 1; }
.page-projects .item > .shot {
  grid-column: 2;
  grid-row: 1;
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  margin: 0;
  border: 0;
  padding: 0;
}
.page-projects .item > .video { aspect-ratio: 16 / 9; }
@media (max-width: 860px) {
  .page-projects .item { display: block; }
  .page-projects .item > .shot { margin-bottom: 12px; }
}
.layer {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}
.drawing .layer { pointer-events: auto; touch-action: none; cursor: crosshair; }
.canvas-frame { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
html, body { overscroll-behavior: none; }

/* palette */
.palette { display: flex; align-items: center; gap: 6px; padding: 6px 2px 4px; flex: none; }
.current {
  position: relative;
  width: 30px; height: 30px;
  border: 1px solid;
  border-color: var(--shadow) var(--hi) var(--hi) var(--shadow);
  flex: none;
}
.current .fg, .current .bg { position: absolute; width: 14px; height: 14px; border: 1px solid #000; }
.current .fg { top: 4px; left: 4px; z-index: 1; }
.current .bg { bottom: 4px; right: 4px; }
.swatches { display: grid; grid-template-columns: repeat(14, 15px); grid-auto-rows: 15px; gap: 1px; }
.swatches button {
  padding: 0;
  border: 1px solid;
  border-color: var(--shadow) var(--hi) var(--hi) var(--shadow);
  cursor: pointer;
}

.statusbar { display: flex; gap: 3px; flex: none; }
.statusbar div {
  border: 1px solid;
  border-color: var(--shadow) var(--hi) var(--hi) var(--shadow);
  padding: 2px 6px;
  white-space: nowrap;
  overflow: hidden;
}
.statusbar div:first-child { flex: 1; }
.statusbar div:last-child { width: 90px; }

/* closed / minimized screens */
.off {
  position: fixed;
  inset: 0;
  background: #000;
  color: #ff8c00;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  font: bold 24px/1.3 Tahoma, sans-serif;
  text-align: center;
  padding: 16px;
  cursor: pointer;
}
.off small { font-size: 13px; color: #aaa; font-weight: normal; }
.taskbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: var(--face);
  border-top: 2px solid var(--hi);
  padding: 3px;
  display: flex;
  gap: 4px;
}
.taskbar button {
  font: bold 12px Tahoma, sans-serif;
  background: var(--face);
  border: 2px solid;
  border-color: var(--hi) var(--dark) var(--dark) var(--hi);
  padding: 3px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* content inside the canvas */
.canvas h1 { color: var(--ink); font-size: 40px; margin: 0 0 6px; line-height: 1.2; }
/* Experience / Projects: centered title, intro line evenly spaced between title and first section */
.canvas > h1, .canvas > h2, .canvas > .lead { text-align: center; }
.canvas > h1 { margin-bottom: 22px; }
.canvas > .lead + h2 { margin-top: 17px; }
.canvas h2 {
  color: var(--ink);
  font-size: 22px;
  margin: 32px 0 20px;
  padding-bottom: 4px;
  border-bottom: 2px dashed var(--ink);
}
.canvas h3 { font-size: 18px; margin: 0; }
.canvas p { margin: 0 0 12px; }
.canvas a { color: var(--ink); }
.lead { font-size: 17px; color: #555; margin-bottom: 0 !important; }

.links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.btn {
  display: inline-block;
  background: var(--face);
  color: #000 !important;
  text-decoration: none;
  font: 14px Tahoma, sans-serif;
  padding: 7px 20px;
  border: 2px solid;
  border-color: var(--hi) var(--dark) var(--dark) var(--hi);
  box-shadow: inset -1px -1px var(--shadow);
}
.btn:active { border-color: var(--dark) var(--hi) var(--hi) var(--dark); box-shadow: none; }

.item { margin-bottom: 22px; }
.meta { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sub { color: #555; font-size: 15px; margin: 2px 0 6px; }
.item p { margin: 0; }
.date { color: #555; font-size: 15px; white-space: nowrap; }

ul.tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
ul.tags li { border: 2px solid var(--ink); padding: 4px 14px; font-size: 16px; }

/* photo, framed like a Paint selection */
.hero { display: flex; align-items: center; gap: 22px; margin-bottom: 16px; flex-wrap: wrap; }
.hero h1 { margin: 0; }
.hero .sub { margin: 4px 0 0; }
.photo { margin: 0; padding: 4px; border: 1px dashed #000; flex: none; }
.photo img { display: block; width: 200px; height: 200px; object-fit: cover; }

@media (max-width: 640px) {
  .workspace { flex-direction: column; }
  .toolbox { width: auto; grid-template-columns: repeat(8, 1fr); grid-auto-rows: 36px; }
  .toolbox button { font-size: 17px; }
  .swatches { grid-auto-rows: 20px; }
  .toolbox .well { display: none; }
  .controls button:nth-child(2), .statusbar div:last-child { display: none; }
  .canvas { padding: 20px 16px 28px; }
  .swatches { grid-template-columns: repeat(14, 1fr); flex: 1; }
}

/* landing page: big photo + links on the left, intro on the right, centered in the window */
.page-about .canvas { display: flex; flex-direction: column; justify-content: center; }
.page-about .canvas > .intro { max-width: none; }
.intro { display: flex; align-items: center; justify-content: flex-start; gap: 56px; width: 100%; }
.intro .left { flex: none; display: flex; flex-direction: column; align-items: stretch; }
.intro .photo img { width: min(420px, 32vw, 55vh); height: min(420px, 32vw, 55vh); }
@media (max-width: 900px) {
  .intro { flex-direction: column; gap: 24px; }
  .intro .photo img { width: 320px; height: 320px; }
  .intro .right h1, .intro .right .sub { text-align: center; }
}
.intro .links { margin: 8px 0 0; gap: 6px; flex-wrap: nowrap; }
.intro .links .btn { flex: 1; text-align: center; padding-left: 0; padding-right: 0; }
.intro .right { flex: 1; max-width: 680px; }
.intro .right h1 { font-size: 52px; text-align: left; }
.intro .right .sub { margin: 4px 0 22px; font-size: 17px; }
.intro .right p { text-align: left; margin-bottom: 18px; }
.item { margin-bottom: 28px; }

@media (max-width: 640px) {
  .canvas { font-size: 16px; padding: 22px 16px 28px; }
  .canvas h1, .intro .right h1 { font-size: 34px; }
  .intro { flex-direction: column; gap: 24px; }
  .intro .photo img { width: 260px; height: 260px; }
  .intro .right h1 { text-align: center; }
  .intro .right .sub { text-align: center; }
}

/* blank drawing page: the whole canvas is paper */
.page-draw .canvas { padding: 0; }

/* project title row: name left, date right */
.page-projects .info .meta { align-items: baseline; }
.page-projects .item > a.shot img { display: block; width: 100%; height: auto; }
.page-projects .item > a.shot { cursor: zoom-in; }

/* project tags: each tag is its own box, so lines never end on a dangling "·" */
ul.chips { list-style: none; padding: 0; margin: 4px 0 10px; display: flex; flex-wrap: wrap; gap: 6px; }
ul.chips li {
  font: 13px Tahoma, sans-serif;
  color: #333;
  background: #eee;
  border: 1px solid #ccc;
  padding: 1px 8px;
  white-space: nowrap;
}
ul.chips li.wip { background: #fff; border-color: var(--ink); color: var(--ink); }
.result { margin-top: 8px !important; }
.result b { color: var(--ink); }
.page-projects .item { scroll-margin-top: 16px; }

@media (max-width: 640px) {
  /* dates always on their own line under the title */
  .meta { flex-direction: column; gap: 0; }
  .meta .date { margin-bottom: 2px; }
  /* smaller photo so the name and intro show up first */
  .intro .photo img { width: 150px !important; height: 150px !important; }
  .intro .left { width: 100%; align-items: center; }
  .intro .links { flex-wrap: wrap; justify-content: center; }
  .intro .links .btn { flex: 0 0 auto; padding: 6px 14px; }
}

/* doodle gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; margin-top: 24px; }
.gallery figure { margin: 0; border: 1px dashed #000; padding: 6px; background: #fff; }
.gallery img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: #fff; }
.gallery figcaption { font: 13px Tahoma, sans-serif; color: #555; margin-top: 6px; text-align: center; }

/* Win98-style dialog */
.dialog-shade { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.25); display: flex; align-items: center; justify-content: center; z-index: 10; padding: 16px; }
.dialog {
  background: var(--face);
  border: 2px solid;
  border-color: var(--hi) var(--dark) var(--dark) var(--hi);
  padding: 3px;
  width: 100%;
  max-width: 360px;
  font: 13px Tahoma, sans-serif;
}
.dialog-body { padding: 14px 12px 4px; }
.dialog-body p { margin: 0 0 12px; }
.dialog-body input {
  width: 100%; margin-top: 4px; padding: 4px 6px; font: 13px Tahoma, sans-serif;
  border: 2px solid; border-color: var(--shadow) var(--hi) var(--hi) var(--shadow); background: #fff;
}
.dialog-error { color: #b00020; min-height: 1em; }
.dialog-buttons { display: flex; justify-content: flex-end; gap: 8px; padding: 6px 12px 12px; }
.dialog-buttons .btn { min-width: 76px; cursor: pointer; }
.dialog .titlebar .controls button { cursor: pointer; }
