@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/IBMPlexMono-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/IBMPlexMono-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: block;
}

:root {
  --paper: #ecebe7;
  --ink: #161616;
  --pad-x: 36px;
  --pad-y: 32px;
  --type: 12px;
  --lead: 18px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: var(--type);
  font-weight: 400;
  line-height: var(--lead);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: 0;
  appearance: none;
  -webkit-appearance: none;
}

button {
  cursor: pointer;
}

::selection {
  background: var(--ink);
  color: var(--paper);
}

/* —— header —— */

.top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: var(--pad-y) var(--pad-x) 0;
  position: relative;
  z-index: 2;
}

.mark {
  letter-spacing: 0.18em;
  font-weight: 400;
}

.mark:hover {
  text-decoration: none;
}

.nav {
  display: flex;
  gap: 1.75em;
}

.nav span {
  opacity: 0.35;
}

/* —— landing —— */

body.landing {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body.landing .top {
  flex: 0 0 auto;
}

.stage {
  flex: 1 1 auto;
  height: auto;
  padding: 18px var(--pad-x) 10px;
  display: flex;
  align-items: flex-end;
  gap: 28px;
  min-height: 0;
}

.piece {
  height: 100%;
  display: flex;
  align-items: flex-end;
  gap: 28px;
  min-width: 0;
  outline: none;
}

.frame {
  height: 100%;
  width: auto;
  max-width: min(58vw, 620px);
  display: block;
  position: relative;
  cursor: pointer;
  flex: 0 0 auto;
}

.frame img {
  height: 100%;
  width: auto;
  max-width: min(58vw, 620px);
  display: block;
  object-fit: contain;
  object-position: left bottom;
  user-select: none;
  -webkit-user-drag: none;
}

.plate {
  height: 100%;
  width: min(58vw, 520px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  cursor: pointer;
}

.plate.sound {
  width: min(70vw, 720px);
  justify-content: center;
}

.plate-kicker {
  margin-bottom: 14px;
}

.plate-title {
  font-size: 12px;
  line-height: 18px;
  margin-bottom: 10px;
}

.plate-line {
  max-width: 28em;
}

.blank-plate {
  width: min(42vw, 380px);
  height: 100%;
  max-height: 100%;
  aspect-ratio: 3 / 4;
  background: #e2e0db;
  display: flex;
  align-items: flex-end;
  padding: 16px;
  cursor: pointer;
}

.wave {
  width: 100%;
  height: 48px;
  display: block;
}

.wave path {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.meta {
  align-self: flex-end;
  padding-bottom: 2px;
  opacity: 0;
  transition: opacity 120ms linear;
  pointer-events: none;
  white-space: nowrap;
}

.piece:hover .meta,
.piece.focus .meta,
body.show-caption .meta {
  opacity: 1;
}

.count {
  position: fixed;
  right: var(--pad-x);
  bottom: 16px;
  opacity: 0.35;
  pointer-events: none;
}

.credit {
  font-size: 10px;
  line-height: 14px;
  font-weight: 400;
  opacity: 0.35;
  margin: 0;
  padding: 0 var(--pad-x) 16px;
  pointer-events: none;
}

body.landing .credit {
  flex: 0 0 auto;
}

/* —— index / works —— */

body.page {
  min-height: 100%;
  height: auto;
  display: flex;
  flex-direction: column;
}

body.page .credit {
  margin-top: auto;
  padding-top: 24px;
  padding-bottom: 20px;
}

.list {
  padding: 40px var(--pad-x) 24px;
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  column-gap: 48px;
  row-gap: 40px;
  align-content: space-between;
  min-height: calc(100vh - 56px - 58px);
}

.entry {
  display: block;
}

.entry a:hover {
  text-decoration: none;
}

.entry h2 {
  font-size: 12px;
  font-weight: 400;
  line-height: 18px;
}

.entry .who {
  margin-top: 2px;
}

.entry-seed {
  display: flex;
  align-items: flex-start;
  gap: 22px;
  max-width: 520px;
  grid-column: 1;
  grid-row: 1;
}

.entry-seed img {
  width: 200px;
  height: auto;
  display: block;
}

.entry-seed .cap {
  padding-top: 2px;
}

.entry-essay {
  grid-column: 2;
  grid-row: 1;
  margin-left: 12%;
  margin-top: 56px;
  max-width: 36em;
}

.entry-essay .lead {
  margin-top: 10px;
}

.entry-sound {
  grid-column: 1;
  grid-row: 2;
  margin-top: 12px;
  max-width: 620px;
}

.entry-sound .wave {
  margin-top: 16px;
  height: 36px;
}

.entry-blank {
  grid-column: 2;
  grid-row: 2;
  justify-self: end;
  margin-right: 8%;
  width: 200px;
}

.entry-blank .ph {
  width: 150px;
  height: 200px;
  background: #e0ded8;
  border: 1px solid #d0cec8;
  margin-bottom: 14px;
  display: flex;
  align-items: flex-end;
  padding: 10px;
}

.entry a:hover h2,
.entry a:hover .who,
.entry a:hover .lead {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* —— submit —— */

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-inline-size: 0;
}

legend {
  padding: 0;
}

form.submit {
  padding: 48px var(--pad-x) 96px;
  max-width: calc(400px + var(--pad-x));
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field input[type="text"],
.field input[type="url"],
.field textarea {
  border-bottom: 1px solid var(--ink);
  padding: 2px 0 5px;
  width: 100%;
  outline: none;
  line-height: 18px;
  height: 26px;
}

.field textarea {
  height: auto;
  min-height: 6em;
  resize: none;
}

.field input:focus,
.field textarea:focus {
  border-bottom-width: 2px;
  padding-bottom: 4px;
}

.formats {
  display: flex;
  gap: 1.6em;
  padding: 4px 0 0;
}

.formats label {
  cursor: pointer;
  opacity: 0.35;
}

.formats input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.formats label:has(input:checked) {
  opacity: 1;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 1px;
}

.file-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.file-row input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.file-row .pick {
  border-bottom: 1px solid var(--ink);
  padding: 4px 0 6px;
  cursor: pointer;
  white-space: nowrap;
}

.file-row .pick:hover {
  text-decoration: none;
}

.file-row .or {
  opacity: 0.4;
}

.file-row input[type="url"],
.file-row input[type="text"] {
  flex: 1;
  min-width: 0;
}

.send {
  align-self: flex-start;
  margin-top: 8px;
  border-bottom: 1px solid var(--ink);
  padding: 0 0 2px;
}

.send:hover {
  text-decoration: none;
}

/* —— mobile —— */

@media (max-width: 700px) {
  :root {
    --pad-x: 18px;
    --pad-y: 20px;
  }

  body.landing {
    overflow: auto;
  }

  body.landing .credit {
    margin-top: auto;
    padding-bottom: 18px;
  }

  .stage {
    flex: 0 0 auto;
    height: auto;
    min-height: 0;
    padding: 20px var(--pad-x) 8px;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .piece {
    flex-direction: column;
    align-items: stretch;
    height: auto;
    gap: 16px;
  }

  .frame,
  .frame img {
    height: auto;
    width: 100%;
    max-width: none;
  }

  .plate,
  .plate.sound,
  .blank-plate {
    width: 100%;
    height: auto;
    min-height: 60vw;
  }

  .blank-plate {
    aspect-ratio: 3 / 4;
    height: auto;
  }

  .meta {
    opacity: 1;
    white-space: normal;
    align-self: flex-start;
  }

  .count {
    position: static;
    display: block;
    text-align: right;
    padding: 4px var(--pad-x) 8px;
    bottom: auto;
    right: auto;
  }

  .list {
    padding: 36px var(--pad-x) 80px;
    display: flex;
    flex-direction: column;
    gap: 48px;
    row-gap: 48px;
  }

  .entry-seed,
  .entry-essay,
  .entry-sound,
  .entry-blank {
    grid-column: auto;
    grid-row: auto;
    margin: 0;
    width: auto;
    max-width: none;
    justify-self: start;
  }

  .entry-seed {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .entry-seed img {
    width: 42vw;
    max-width: 180px;
  }

  .entry-essay {
    padding-left: 12%;
  }

  .entry-sound {
    padding-left: 0;
  }

  .entry-blank {
    padding-left: 28%;
  }

  form.submit {
    padding: 36px var(--pad-x) 80px;
    max-width: none;
  }
}

/* —— live additions —— */

.entry-second {
  grid-column: 2;
  grid-row: 2;
  justify-self: end;
  margin-right: 8%;
  display: flex;
  align-items: flex-start;
  gap: 22px;
}

.entry-second img,
.entry-seed img {
  display: block;
}

.entry-second img {
  width: 200px;
  height: auto;
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.hint {
  opacity: 0.4;
  font-size: 10px;
  line-height: 14px;
  margin-top: 2px;
}

.hint .file-name {
  opacity: 1;
  margin-right: 10px;
  color: var(--ink);
}

.status {
  min-height: 18px;
  opacity: 0.6;
  margin-top: -8px;
}

.status.err {
  opacity: 1;
}

.send[disabled] {
  opacity: 0.35;
  cursor: default;
}

.thanks {
  padding: 48px var(--pad-x) 96px;
  max-width: calc(420px + var(--pad-x));
}

.thanks p + p {
  margin-top: 14px;
}

.thanks .quiet {
  opacity: 0.6;
}

.field input[type="email"] {
  border-bottom: 1px solid var(--ink);
  padding: 2px 0 5px;
  width: 100%;
  outline: none;
  line-height: 18px;
  height: 26px;
}

.field input[type="email"]:focus {
  border-bottom-width: 2px;
  padding-bottom: 4px;
}

@media (max-width: 700px) {
  .entry-second {
    grid-column: auto;
    grid-row: auto;
    margin: 0;
    padding-left: 28%;
    flex-direction: column;
    gap: 14px;
  }
  .entry-second img { width: 42vw; max-width: 180px; }
  .thanks { padding: 36px var(--pad-x) 80px; max-width: none; }
}

[hidden] { display: none !important; }

@media (min-width: 701px) {
  .list { align-content: start; }
  .entry-second {
    grid-column: 2;
    grid-row: 1;
    justify-self: start;
    margin-left: 12%;
    margin-right: 0;
    margin-top: 120px;
  }
}
