/* Fonts aligned with the-documents.org (Haegeman Temmerman) */
@font-face {
  font-family: "Arial Mono MT Pro";
  src: local("Arial Mono MT Pro Bold"), local("ArialMonoMTPro-Bold");
  font-weight: bold;
  font-style: normal;
}

:root {
  --font-serif: Times, "Times New Roman", serif;
  --font-mono: "Arial Mono MT Pro", "Arial Mono", "Courier New", Courier, monospace;
  --font-size-body: 1rem;
  --font-size-title: 1.3em;
  --font-size-mono: 0.9em;
  --font-size-h2: 1.22em;
}

html {
  /* fixed base so local and live look the same regardless of window width */
  font-size: 14px;
}

@media (max-width: 800px) {
  html {
    font-size: 17px;
  }
}

body {
  margin: 16px 20px;
  background: #ffffff;
  color: #000000;
  max-width: 760px;
  font-family: var(--font-serif);
  font-size: var(--font-size-body);
  line-height: 1.25;
}

body:has(.index-layout) {
  max-width: min(1800px, 98vw);
  box-sizing: border-box;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  padding: 14px 12px;
  overflow: hidden;
}

html:has(.index-layout) {
  height: 100%;
  overflow: hidden;
}

h1,
h2 {
  font-family: inherit;
  font-weight: normal;
  line-height: 1.2;
}

h1 {
  font-size: var(--font-size-title);
  margin: 0 0 0.3em 0;
}

h1 .site-home-link,
h1 .site-home-link:visited {
  color: #000000;
  text-decoration: none;
}

h2 {
  font-size: var(--font-size-h2);
  margin: 1.2em 0 0.3em 0;
}

.work-page h2 {
  font-size: 1em;
}

a, a:visited {
  color: #0000ee;
}

p {
  margin: 0 0 0.5em 0;
}

img {
  max-width: 100%;
  height: auto;
  margin: 6px 0;
  display: block;
}

.video-wrap {
  width: 100%;
  margin: 6px 0;
}

.video-wrap video {
  width: 100%;
  height: auto;
  display: block;
  margin: 0;
}

.iframe-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: var(--iframe-aspect, 16 / 9);
  margin: 6px 0;
  overflow: clip;
  background: #000;
}

.iframe-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  margin: 0;
  overflow: hidden;
}

.video-crop {
  width: 100%;
  max-width: 100%;
  margin: 6px 0;
}

.video-crop__viewport {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.video-crop__media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  object-fit: cover;
  object-position: var(--video-pos, 50% 50%);
  transform: scale(var(--video-zoom, 3));
  transform-origin: var(--video-pos, 50% 50%);
}

.video-crop__bar {
  display: flex;
  align-items: center;
  gap: 0.6em;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: var(--font-size-mono);
}

.video-crop__bar button {
  font: inherit;
  cursor: pointer;
  padding: 0;
  border: none;
  background: none;
  color: #0000ee;
}

.video-crop__bar button:hover {
  text-decoration: underline;
}

.video-crop__seek {
  flex: 1;
  min-width: 0;
  margin: 0;
}

.audio-player {
  width: 100%;
  margin: 4px 0 8px 0;
}

.audio-player audio {
  display: block;
  width: 100%;
  margin: 0;
}

/* index — scroll areas (intro / works / log) */
:root {
  --index-intro-max: 18vh;
  --index-works-max: 14vh;
  --index-live-max: 12vh;
  --index-log-offset: 8.5rem;
}

/* smaller window: works gets a larger share than log */
@media (max-height: 900px) {
  :root {
    --index-intro-max: 16vh;
    --index-works-max: 16vh;
    --index-live-max: 12vh;
    --index-log-offset: 8rem;
  }
}

@media (max-height: 700px) {
  :root {
    --index-intro-max: 14vh;
    --index-works-max: 18vh;
    --index-live-max: 14vh;
    --index-log-offset: 7.5rem;
  }
}

/* index — two equal columns */

.index-layout {
  display: flex;
  gap: 20px;
  align-items: stretch;
  justify-content: flex-start;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.index-main {
  flex: 0 0 30%;
  min-width: 0;
  max-width: 30%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}

.index-aside {
  flex: 1 1 auto;
  min-width: 0;
  max-width: none;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

/* wide screens only: keep right column from growing too wide */
@media (min-width: 1400px) {
  .index-aside {
    flex: 0 1 50%;
    width: 50%;
    max-width: 50%;
  }
}

.index-intro {
  max-height: var(--index-intro-max);
  overflow-y: auto;
}

.index-works-scroll {
  max-height: var(--index-works-max);
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

.index-live-scroll {
  max-height: var(--index-live-max);
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

.index-works-block {
  flex: 0 0 auto;
  min-height: 0;
}

.index-works-block h2,
.index-log-scroll h2 {
  margin-top: 0.6em;
  margin-bottom: 0.15em;
}

.index-log-scroll {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.index-log-scroll .log {
  flex: 1 1 auto;
  min-height: 8rem;
  height: auto;
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.index-log-scroll .meta {
  flex: 0 0 auto;
  margin-top: 0.35em;
}

.index-portrait img {
  width: 100%;
  height: auto;
  margin: 0;
  display: block;
  object-fit: contain;
}

.index-portrait[hidden],
.work-panel[hidden],
.live-panel[hidden],
.index-aside[hidden] {
  display: none;
}

.index-aside-back {
  display: inline-block;
  margin-top: 0.8em;
  font-family: inherit;
  font-size: inherit;
}

.index-aside-back[hidden] {
  display: none;
}

.work-link.is-active {
  font-weight: bold;
}

.live-link.is-active {
  font-weight: bold;
}

@media (max-width: 800px) {
  html:has(.index-layout),
  body:has(.index-layout) {
    height: auto;
    overflow: visible;
  }

  body:has(.index-layout) {
    padding: 12px;
  }

  .index-layout {
    flex-direction: column;
    height: auto;
    overflow: visible;
  }

  .index-main,
  .index-aside {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: none;
  }

  .index-main {
    display: block;
    overflow: visible;
  }

  .index-log-scroll {
    display: block;
    overflow: visible;
  }

  .index-intro {
    max-height: none;
    overflow-y: visible;
  }

  .index-works-scroll,
  .index-live-scroll {
    max-height: none;
    overflow: visible;
  }

  .index-log-scroll .log {
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .index-aside {
    overflow: visible;
    margin: 0.35em 0 1em;
  }

  /* detail opens under the clicked list item */
  .index-works-scroll > .index-aside,
  .index-live-scroll > .index-aside,
  .index-main > .index-aside {
    width: 100%;
    max-width: 100%;
  }

  /* detail heading would duplicate the list title */
  .work-page h1 {
    display: none;
  }

  /* mono subtitle already shown as list caption */
  .work-subtitle {
    display: none;
  }
}

/* Mono text (metadata, log) — Arial Mono MT Pro on the-documents.org */

.log,
.log p,
.log-heading,
.log-text,
.work .caption,
.label,
.meta,
pre,
code {
  font-family: var(--font-mono);
}

.lead,
.small {
  line-height: 1.2;
}

.bio-toggle {
  display: none;
  margin: 0.15em 0 0.4em;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  color: #0000ee;
  cursor: pointer;
}

.bio-toggle:hover {
  text-decoration: underline;
}

@media (max-width: 800px) {
  .bio-toggle {
    display: inline;
  }

  .bio.is-collapsed .bio-rest {
    display: none;
  }
}

.work {
  margin-bottom: 0.3em;
}

.work .title,
.work .title a {
  font-size: 1em;
  line-height: 1.2;
}

@media (max-width: 800px) {
  .work .title a.is-active {
    font-size: var(--font-size-h2);
  }
}

.work .caption {
  font-size: var(--font-size-mono);
}

.log {
  font-size: var(--font-size-mono);
  line-height: 1.25;
}

.log p {
  display: flex;
  align-items: baseline;
  gap: 0.6em;
  margin: 0;
}

.log .date {
  flex: 0 0 11ch;
  white-space: nowrap;
}

.log-text {
  flex: 1;
  min-width: 0;
}

.log-heading {
  margin-top: 0.6em;
  margin-bottom: 0.15em;
  font-family: var(--font-serif);
  font-size: var(--font-size-body);
  line-height: 1.25;
}

.log-heading:first-child {
  margin-top: 0;
}

/* work pages — body Times; subtitle like index captions / log */

.work-page {
  font-family: var(--font-serif);
}

.work-page p {
  line-height: 1.2;
  margin: 0.3em 0;
}

.work-page h1 {
  margin: 0 0 0.2em 0;
}

.work-subtitle {
  font-family: var(--font-mono);
  font-size: var(--font-size-mono);
  line-height: 1.25;
  margin: 0;
}

/* one blank line at body size (not subtitle em) */
.work-subtitle + .work-text {
  margin-top: 1.25em;
}

.label {
  font-size: 0.92em;
}

.section {
  margin-top: 1em;
}

pre {
  background-color: #f4f4f4;
  color: #000000;
  padding: 10px;
  overflow-x: auto;
  font-size: 0.88em;
  line-height: 1.25;
  margin: 8px 0;
}

code {
  font-size: 0.88em;
}

/* page footer (last updated) */

.meta {
  font-size: var(--font-size-mono);
  color: #555;
  margin-top: 1.5em;
}
