/* The studio: quiet, dark, the same type as the drift. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root { --ink: #fff; --dim: rgba(255, 255, 255, .6); --line: rgba(255, 255, 255, .25); --coral: #ef6a42; }

html, body { min-height: 100%; }
body {
  background: #111;
  color: var(--ink);
  font: 1.1rem/1.5 "Crete Round", Georgia, serif;
  -webkit-font-smoothing: antialiased;
}

.studio {
  max-width: 32rem;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  padding: 10vh 1.5rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

/* The mark: Æ opens the map (map.css), the period goes back to the drift. */
.studio-mark { font: 3rem/1 "Tilt Prism", Georgia, serif; color: var(--ink); }
.studio-mark .aleph { text-decoration: none; }

/* The studio's index: quiet words, the section you're in in coral. */
.studio-index { display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; margin-bottom: 1.2rem; font-style: italic; }
.studio-index a { color: var(--dim); text-decoration: none; }
.studio-index a:hover, .studio-index a:focus-visible { color: var(--ink); }
.studio-index a[aria-current="page"] { color: var(--coral); }

/* The studio's front page. */
.studio .ways, .studio .fragments, .studio .loops, .studio .conjunctions { padding-left: 0; }
.ways { list-style: none; display: flex; flex-direction: column; gap: .5rem; font-size: 1.25rem; font-style: italic; }
.ways .quiet { font-style: normal; margin-left: .3rem; }
.tally { margin-top: 1rem; }

.lede { font-style: italic; font-size: 1.35rem; }
.quiet { color: var(--dim); font-size: .95rem; }
.note { color: var(--coral); }
a { color: inherit; text-decoration-color: var(--line); text-underline-offset: .2em; }
a:hover { color: var(--coral); }

form { display: flex; flex-direction: column; gap: 1rem; margin-top: .5rem; }
label { display: flex; flex-direction: column; gap: .35rem; color: var(--dim); font-size: .95rem; }
.field { display: flex; align-items: baseline; color: var(--dim); }
input {
  font: inherit;
  font-size: 1.1rem;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: .35rem 0;
  border-radius: 0;
  width: 100%;
}
.field input { width: auto; flex: 1; min-width: 0; }
input:focus { outline: none; border-bottom-color: var(--coral); }

button {
  align-self: flex-start;
  font: italic 1.05rem "Crete Round", Georgia, serif;
  color: #111;
  background: var(--ink);
  border: 0;
  padding: .55rem 1.1rem;
  cursor: pointer;
}
button:hover { background: var(--coral); }

/* Sections of the studio. */
section { display: flex; flex-direction: column; gap: .8rem; padding-top: 1.6rem; border-top: 1px solid var(--line); }
h2 { font: italic 1.15rem "Crete Round", Georgia, serif; color: var(--dim); }
h2 .quiet { font-style: normal; margin-left: .3rem; }

textarea {
  font: italic 1.15rem/1.45 "Crete Round", Georgia, serif;
  color: var(--ink);
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
  padding: .6rem .7rem;
  resize: vertical;
  width: 100%;
}
textarea:focus { outline: none; border-color: var(--coral); }

.degrees { align-self: flex-end; font-size: .85rem; color: var(--dim); min-height: 1.2em; }
.degrees.near { color: var(--coral); }
.degrees.full { color: #ff9b7a; }

.fragments { list-style: none; display: flex; flex-direction: column; gap: 1.1rem; }
.fragment p { font-style: italic; overflow-wrap: anywhere; }
.fragment .source { display: block; margin-top: .2rem; font-size: .9em; color: var(--dim); }
.actions { display: flex; align-items: baseline; gap: 1rem; margin-top: .3rem; font-size: .9rem; }
.actions form, .loop .actions form { display: inline; margin: 0; }
.actions a { color: var(--dim); }

button.link {
  background: none;
  color: var(--dim);
  padding: 0;
  font: inherit;
  font-size: .9rem;
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: .2em;
}
button.link:hover { background: none; color: var(--coral); }

.sign-out { flex-direction: row; align-items: baseline; gap: .8rem; margin-top: 1.5rem; }

/* Loops in the studio: a small grid of live loops. */
.studio .loops, .loops { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: .9rem; }
.loop video { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: #000; image-rendering: pixelated; display: block; }
.loop form { margin-top: .3rem; }
.loops .quiet { grid-column: 1 / -1; }

a.button {
  display: inline-block;
  font: italic 1.05rem "Crete Round", Georgia, serif;
  color: #111;
  background: var(--ink);
  padding: .55rem 1.1rem;
  text-decoration: none;
}
a.button:hover { background: var(--coral); color: #111; }

/* The still. */
.still-video { width: 100%; max-height: 60vh; background: #000; display: block; }
.still-video[hidden] { display: none; }
.pixelated { image-rendering: pixelated; }
input[type="range"] { width: 100%; accent-color: var(--coral); border: 0; padding: 0; }
input[type="file"] { border: 0; color: var(--dim); }
fieldset.seam { border: 0; display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; }
fieldset.seam legend { color: var(--dim); font-size: .95rem; margin-bottom: .35rem; }
fieldset.seam label { flex-direction: row; align-items: center; gap: .4rem; color: var(--ink); font-size: 1rem; }
fieldset.seam input { width: auto; accent-color: var(--coral); }
#still-trim { display: flex; flex-direction: column; gap: 1rem; }
#still-pick[hidden], #still-trim[hidden], #still-done[hidden] { display: none; }
.actions-row { display: flex; align-items: baseline; gap: 1.2rem; }

/* The still, simplified: one drop zone, one button. */
.drop {
  position: relative;
  border: 1px dashed var(--line);
  padding: 2.4rem 1rem;
  align-items: center;
  text-align: center;
  cursor: pointer;
  gap: .3rem;
}
.drop:hover, .drop.over { border-color: var(--coral); }
.drop input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop-lede { font-style: italic; font-size: 1.25rem; color: var(--ink); }
button.big { font-size: 1.2rem; padding: .7rem 1.4rem; }
details summary { cursor: pointer; color: var(--dim); }
details summary:hover { color: var(--coral); }
details[open] { display: flex; flex-direction: column; gap: .8rem; }
.guide ul { padding-left: 1.1rem; display: flex; flex-direction: column; gap: .5rem; font-size: .98rem; }
.guide p { font-size: .98rem; }
#still-ready[hidden], #still-done[hidden] { display: none; }

/* Conjunctions in the studio: a loop beside its fragment. */
.conjunctions { list-style: none; display: flex; flex-direction: column; gap: 1.1rem; }
.conjunction { display: grid; grid-template-columns: 7rem 1fr; gap: .9rem; align-items: start; }
.conjunction video { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; background: #000; image-rendering: pixelated; display: block; }
.conjunction p { font-style: italic; overflow-wrap: anywhere; }
.conjunction .source { display: block; margin-top: .2rem; font-size: .9em; color: var(--dim); }
.conjunction form { margin-top: .3rem; }

/* Report form and the rules pages. */
fieldset.kinds { border: 0; display: flex; flex-direction: column; gap: .5rem; }
fieldset.kinds legend { color: var(--dim); font-size: .95rem; margin-bottom: .35rem; }
fieldset.kinds label, label.check { flex-direction: row; align-items: baseline; gap: .55rem; color: var(--ink); font-size: 1rem; }
fieldset.kinds input, label.check input { width: auto; accent-color: var(--coral); }
.copyright-fields { display: flex; flex-direction: column; gap: .9rem; padding: .9rem 0; border-top: 1px dashed var(--line); }
.copyright-fields[hidden] { display: none; }
.studio h2 { margin-top: .6rem; }
.studio ul, .studio ol { padding-left: 1.2rem; display: flex; flex-direction: column; gap: .35rem; }

/* The pairing page: one loop and its fragment, credits, and lineage. */
.pairing-loop { width: 100%; max-height: 62vh; object-fit: contain; background: #000; image-rendering: pixelated; display: block; }
.pairing-text { font-style: italic; font-size: 1.3rem; line-height: 1.45; overflow-wrap: anywhere; }
.credits { line-height: 1.6; }
.lineage { list-style: none; padding: 0; display: flex; flex-direction: column; gap: .35rem; }

/* Tags. */
.tags { font-size: .9rem; color: var(--coral); opacity: .8; }
.tag-form { flex-direction: row; align-items: baseline; gap: .5rem; margin-top: .35rem; }
.tag-form input { font-size: .9rem; padding: .15rem 0; min-width: 0; }

/* The re-render tool. */
#rr { display: flex; flex-direction: column; gap: 1rem; }
.rr-now video, .rr-version video { width: 100%; max-height: 50vh; object-fit: contain; background: #000; display: block; }
.rr-now figcaption { margin-top: .3rem; font-size: .9rem; }
.rr-controls { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: .9rem 1.2rem; align-items: end; }
.rr-controls .big { grid-column: 1 / -1; justify-self: start; }
select {
  font: inherit; font-size: 1rem; color: var(--ink); background: #111;
  border: 0; border-bottom: 1px solid var(--line); padding: .35rem 0; border-radius: 0;
}
select:focus { outline: none; border-bottom-color: var(--coral); }
.rr-versions { list-style: none; display: flex; flex-direction: column; gap: 1.6rem; }
.rr-version p { margin-top: .35rem; font-size: .95rem; }
.rr-version .actions { flex-wrap: wrap; }

/* Loop points in the still. */
.points { display: flex; flex-direction: column; gap: .5rem; }
.point-list { display: flex; flex-direction: column; gap: .4rem; align-items: flex-start; }
button.point {
  background: none;
  color: var(--dim);
  border: 1px solid var(--line);
  font-size: .95rem;
  padding: .4rem .7rem;
}
button.point:hover { background: none; color: var(--ink); border-color: var(--ink); }
button.point.is-on { color: #111; background: var(--coral); border-color: var(--coral); }

/* The still: bringing a loop in from a link. */
.link-in { gap: .6rem; }
.loop-from { font-size: .85rem; margin-top: .2rem; overflow-wrap: anywhere; }

/* Loops and conjunctions get room to breathe; words and forms keep a reading width. */
.studio.wide { max-width: 64rem; }
.studio.wide > p, .studio.wide > form, .studio.wide section > h2 { max-width: 32rem; }
.studio.wide .loops { grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 1.6rem 1.2rem; }
.studio.wide .conjunctions { display: grid; grid-template-columns: repeat(auto-fill, minmax(26rem, 1fr)); gap: 1.6rem 2rem; }
@media (max-width: 640px) { .studio.wide .conjunctions { grid-template-columns: 1fr; } }

/* The still in two columns: the clip on the left, choices and guidance on the right. */
.still-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 1.4rem 3rem; align-items: start; }
.still-grid[hidden] { display: none; }
.still-main, .still-side { display: flex; flex-direction: column; gap: 1.2rem; }
.still-grid .still-video { max-height: 70vh; }
.drop { min-height: 16rem; justify-content: center; }
.link-row { display: flex; align-items: flex-end; gap: .8rem; }
.link-row input { flex: 1; min-width: 0; }
.link-row button { flex: none; }
.still-side.guide { border-left: 1px solid var(--line); padding-left: 2rem; }
.still-side.guide h2 { margin-top: 0; }
.still-side.guide ul { padding-left: 0; list-style: none; gap: .8rem; }
.still-side.guide li a { color: var(--ink); }
@media (max-width: 760px) {
  .still-grid { grid-template-columns: 1fr; }
  .still-side.guide { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 1.4rem; }
  .drop { min-height: 11rem; }
}
.still-grid .still-video { object-fit: contain; }
.still-summary { font-style: italic; }
.way-back { margin-top: 1.5rem; }
