@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/IBMPlexSans-Regular.ttf") format("truetype");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/IBMPlexSans-SemiBold.ttf") format("truetype");
}
:root {
  color-scheme: light;
  --paper: #fff;
  --ink: #111;
  --muted: #666;
  --space: 8px;
  --gutter: var(--space);
  --gap: var(--space);
  --blue: #247bd0;
  font-family: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  font-synthesis: none;
  font-size: 13px;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); }
[hidden] { display: none !important; }
h1, h2, p { margin: 0; }
button, input, select { font: inherit; }
button { color: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.masthead {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--space) var(--gap);
  align-items: start;
  padding: calc(var(--space) * 2) var(--gutter) calc(var(--space) * 12);
  min-height: calc(var(--space) * 18);
  font-size: clamp(11px, .73vw, 13px);
  line-height: calc(var(--space) * 2);
}
.masthead h1 { grid-column: 1 / 3; font: inherit; font-weight: 600; white-space: nowrap; }
.discipline { grid-column: 3 / 5; font-weight: 600; }
.location { grid-column: 5; font-weight: 600; }
.bio { grid-column: 6 / 11; grid-row: 1; min-width: 0; max-width: calc(var(--space) * 128); padding-right: calc(var(--space) * 4); font-weight: 400; }
.contact-link { grid-column: 11 / -1; grid-row: 1; justify-self: end; display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 8px 12px; border: 1px solid #ccc; background: var(--paper); color: var(--ink); font-size: 14px; line-height: 1.25; text-decoration: none; white-space: nowrap; }
.contact-link:hover { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.work { position: relative; margin: 0 var(--gutter); }
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
  grid-auto-flow: row dense;
  align-items: stretch;
}
.tile {
  position: relative;
  display: block;
  width: 100%;
  height: var(--row-size, auto);
  aspect-ratio: 1;
  overflow: hidden;
  padding: 0;
  border: 0;
  appearance: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.tile.wide { grid-column: span 2; aspect-ratio: auto; }
.tile video { display: block; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: center; background: #fff; transform: scale(var(--preview-zoom, 1)); transform-origin: center; opacity: 0; pointer-events: none; }
.tile video.ready { opacity: 1; }
.tile.wide video { object-fit: contain; }
.tile-failure { position: absolute; inset: 0; display: grid; place-content: center; padding: 12px; color: var(--muted); }
.tile-config { position: absolute; top: 8px; right: 8px; border: 0; padding: 5px 8px; background: #fff; box-shadow: 0 1px 7px #0002; font-size: 11px; z-index: 1; display: none; }
body.editing .tile { cursor: grab; touch-action: none; user-select: none; outline: 1px dashed #1113; outline-offset: -1px; }
body.editing .tile:active { cursor: grabbing; }
body.editing .tile-config { display: block; }
body.editing .tile:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
body.editing .tile.dragging { opacity: .3; }
body.editing .tile.drop-target { outline: 2px solid var(--blue); outline-offset: -2px; }
.empty { position: absolute; left: 50%; top: 11vw; transform: translateX(-50%); width: min(370px, calc(100% - 28px)); padding: 22px; background: #fff; border: 1px solid #ddd; z-index: 2; }
.empty h2, .settings h2 { font-size: 17px; font-weight: 600; letter-spacing: -.025em; }
.empty p, .settings > p { margin-top: 10px; line-height: 1.5; color: var(--muted); }
.empty .primary { margin-top: 16px; }
.empty.dragover { outline: 2px solid var(--blue); }
.primary { display: inline-flex; align-items: center; background: #171717; color: #fff; border: 1px solid #171717; padding: 8px 13px; font-weight: 550; line-height: 1.25; }
.primary:hover { background: #353535; }
.folder-picker { position: relative; display: inline-flex; cursor: pointer; }
.folder-picker input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.folder-picker:focus-within { outline: 2px solid var(--blue); outline-offset: 3px; }
.tools { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 18px; margin: 0 var(--gutter); padding: 20px 0 26px; }
.tools button, .subtle { padding: 3px 0; border: 0; background: transparent; color: var(--muted); font-size: 12px; cursor: pointer; }
.tools button:hover, .subtle:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.layout-status { margin-right: auto; color: var(--muted); font-size: 12px; }
body.editing .tools { position: sticky; bottom: 0; background: #fffffff2; z-index: 3; margin: 0; padding: 12px var(--gutter); border-top: 1px solid #eee; }
body.visitor .owner { display: none !important; }
.viewer { position: fixed; inset: 0; width: 100dvw; height: 100dvh; max-width: none; max-height: none; margin: 0; border: 0; padding: 48px 24px 24px; overflow: hidden; background: transparent; }
.viewer[open] { display: grid; place-items: center; }
.viewer::backdrop { background: #111b; }
.viewer-content { position: relative; width: fit-content; max-width: 100%; line-height: 0; background: transparent; }
.viewer video { display: block; width: min(calc(100vw - 48px), calc((100dvh - 90px) * var(--video-ratio, 1))); height: auto; max-width: 100%; max-height: calc(100dvh - 90px); object-fit: contain; background: transparent; }
.icon-button { position: relative; width: 32px; height: 32px; border: 0; padding: 0; background: transparent; color: inherit; }
.icon-button span::before, .icon-button span::after { content: ""; position: absolute; top: 15px; left: 7px; height: 1.5px; width: 18px; background: currentColor; transform: rotate(45deg); }
.icon-button span::after { transform: rotate(-45deg); }
.close-viewer { position: fixed; z-index: 2; top: max(10px, env(safe-area-inset-top)); right: 12px; color: #fff; }
.player-status { position: absolute; bottom: 45px; left: 12px; right: 12px; background: #fff; color: #111; padding: 12px; line-height: 1.4; }
html.dialog-open { overflow: hidden; }
.settings { width: min(420px, calc(100% - 32px)); max-height: calc(100dvh - 32px); border: 1px solid #ddd; padding: 22px; background: #fff; color: var(--ink); }
.settings::backdrop { background: #1118; }
.settings-heading { display: flex; align-items: center; justify-content: space-between; }
.settings-heading .icon-button { margin: -7px -7px -7px 0; }
form label { display: block; margin: 14px 0 6px; font-size: 12px; color: var(--muted); }
form input, form select { display: block; width: 100%; min-width: 0; padding: 8px; border: 1px solid #ccc; border-radius: 0; background: #fff; color: var(--ink); }
.form-actions { display: flex; gap: 12px; margin-top: 14px; }
.field-note, .status { font-size: 12px; line-height: 1.5; color: var(--muted); margin-top: 10px; }
.status:empty { display: none; }
.settings-actions { display: flex; flex-wrap: wrap; gap: 10px 16px; border-top: 1px solid #eee; padding-top: 17px; margin-top: 20px; }
#contact-form { border-top: 1px solid #eee; margin-top: 18px; }
@media (max-width: 950px) {
  .masthead { grid-template-columns: repeat(6, minmax(0, 1fr)); padding-bottom: calc(var(--space) * 8); }
  .masthead h1 { grid-column: 1 / 3; }
  .discipline { grid-column: 3 / 5; }
  .location { grid-column: 5 / 7; }
  .bio { grid-column: 3 / 6; grid-row: 2; padding-right: 0; font-size: 11px; }
  .contact-link { grid-column: 6; grid-row: 2; }
}
@media (max-width: 700px) {
  .masthead { grid-template-columns: repeat(4, minmax(0, 1fr)); padding-bottom: calc(var(--space) * 6); min-height: 0; gap: calc(var(--space) * 2) var(--gap); }
  .masthead h1 { grid-column: 1 / 3; }
  .discipline { grid-column: 3 / 5; }
  .location { grid-column: 1; grid-row: 2; }
  .bio { grid-column: 2 / 5; grid-row: 2; max-width: 50ch; padding-right: 0; }
  .contact-link { grid-column: 4; grid-row: 3; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .viewer { padding: 46px 10px 20px; }
  .viewer video { width: min(calc(100vw - 20px), calc((100dvh - 90px) * var(--video-ratio, 1))); max-width: calc(100vw - 20px); }
  .empty { top: 55px; }
}
@media (max-width: 430px) {
  .grid { grid-template-columns: 1fr; }
  .tile.wide { grid-column: auto; aspect-ratio: var(--media-ratio, 2); height: auto; }
  .tile-config { top: 6px; right: 6px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }
