@font-face {
  font-family: "Fraunces";
  src: url("/static/fraunces-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Atkinson";
  src: url("/static/atkinson-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Atkinson";
  src: url("/static/atkinson-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #24170f;
  --paper: #f4ead7;
  --paper-deep: #e7d7bc;
  --saffron: #d9841a;
  --moss: #2f4634;
  --rule: #c9b495;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 12% -10%, #fff8ea 0, transparent 42%),
    linear-gradient(160deg, #f7f0e2 0%, var(--paper) 48%, #efe0c6 100%);
  color: var(--ink);
  font-family: "Atkinson", sans-serif;
}

body {
  padding: 1.25rem 1.1rem 2.5rem;
}

.mast { max-width: 38rem; }

.eyebrow {
  margin: 0;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: var(--moss);
}

h1 {
  margin: 0.15rem 0 0.4rem;
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: clamp(3.2rem, 12vw, 5.4rem);
  line-height: 0.86;
  letter-spacing: -0.04em;
}

.lede {
  margin: 0;
  max-width: 28rem;
  font-size: 1.15rem;
  line-height: 1.35;
}

main {
  display: grid;
  grid-template-columns: minmax(16rem, 22rem) 1fr;
  grid-template-areas:
    "controls well"
    "facts well";
  gap: 1.25rem 1.75rem;
  align-items: start;
  margin-top: 1.6rem;
}

.controls { grid-area: controls; }
.well { grid-area: well; }
.facts { grid-area: facts; }

.controls { padding-top: 0.4rem; }

#watch {
  appearance: none;
  border: 0;
  background: var(--saffron);
  color: #1a1008;
  font-family: "Fraunces", serif;
  font-size: 2.15rem;
  line-height: 1;
  padding: 1.05rem 1.15rem 1.15rem;
  width: 100%;
  text-align: left;
  border-radius: 0 0 2.4rem 0;
  cursor: pointer;
}

#watch[disabled] { opacity: 0.55; cursor: wait; }

.length {
  margin: 0.85rem 0 0;
  padding: 0;
  border: 0;
}

.length legend {
  padding: 0;
  font-size: 0.92rem;
  color: var(--moss);
}

.length-option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.45rem;
  font-size: 1.05rem;
  cursor: pointer;
}

.length-option input {
  width: auto;
  margin: 0;
  accent-color: var(--saffron);
}

.hint, .clock { margin: 0.7rem 0 0; }

.clock {
  font-family: "Fraunces", serif;
  font-size: 3.4rem;
  letter-spacing: -0.04em;
  line-height: 1;
}

.clock.open {
  font-size: 2.1rem;
  letter-spacing: -0.02em;
}

.location-box {
  margin-top: 1.4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}

.location-box h3 {
  margin: 0 0 0.4rem;
  font-family: "Fraunces", serif;
  font-size: 1.35rem;
  font-weight: 600;
}

.location-box .quiet {
  margin-top: 0.7rem;
}

.row {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.9rem;
}

.mast-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem 1rem;
  margin-top: 0.9rem;
}

.textlink {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  color: var(--moss);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

#console-link:not([hidden]) {
  color: var(--moss);
}

.quiet {
  appearance: none;
  background: transparent;
  border: 1px solid var(--ink);
  color: var(--ink);
  font-family: "Atkinson", sans-serif;
  font-size: 1rem;
  padding: 0.7rem 0.8rem;
  border-radius: 0;
  cursor: pointer;
}

.quiet[disabled] { opacity: 0.4; cursor: not-allowed; }

.danger { border-color: #7a2e24; color: #7a2e24; }

#archive-favs[aria-pressed="true"] {
  background: var(--saffron);
  border-color: var(--saffron);
}

.facts {
  list-style: none;
  margin: 1.2rem 0 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}

.facts li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: 1.02rem;
}

.facts b { font-weight: 700; }

.well {
  position: relative;
  min-height: 16rem;
  background: #1a120c;
  overflow: hidden;
}

video {
  display: block;
  width: 100%;
  height: min(70vh, 36rem);
  object-fit: contain;
  background: #1a120c;
}

.wellnote {
  position: absolute;
  inset: auto 0 0 0;
  margin: 0;
  padding: 0.7rem 0.9rem;
  color: #f4ead7;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.55));
}

.strip {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1.5rem;
  margin-top: 1.8rem;
  max-width: 62rem;
}

h2 {
  margin: 0 0 0.4rem;
  font-family: "Fraunces", serif;
  font-size: 1.7rem;
  font-weight: 600;
}

.headrow {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.4rem;
}

.headrow h2 { margin: 0; }

#archive { max-width: 62rem; margin-top: 0.4rem; }

.pager { margin-top: 1rem; align-items: center; }

.archive-filters,
#archive-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 0.8rem;
  align-items: end;
  margin: 0.8rem 0;
}

.archive-filters label { display: grid; gap: 0.2rem; font-size: 0.9rem; }

.pick {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 0.3rem;
  font-size: 0.85rem;
}

.favmark {
  margin: 0.25rem 0 0;
  color: var(--saffron);
  font-size: 0.8rem;
}

.thumbs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
  gap: 0.75rem;
}

.shot, .shotwait {
  display: grid;
  width: 100%;
  padding: 0;
  border: 1px solid var(--ink);
  background: #1a120c;
  color: #f4ead7;
  text-align: left;
  font: inherit;
}

.shot { cursor: pointer; }

.shot img, .shotwait span.frame {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: #1a120c;
}

.shotwait span.frame { display: grid; place-items: center; color: #c9b495; }

.shot figcaption, .shotwait figcaption {
  padding: 0.4rem 0.5rem 0.55rem;
  font-size: 0.95rem;
}

.shot figcaption small, .shotwait figcaption small {
  display: block;
  margin-top: 0.15rem;
  color: #c9b495;
  font-size: 0.8rem;
}

.upload {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0 0.5rem 0.5rem;
  color: #f4ead7;
  font-size: 0.85rem;
}

.upload[hidden] { display: none; }

.shotwait .frame .upload {
  padding: 0;
  justify-content: center;
}

.wheel {
  width: 0.95rem;
  height: 0.95rem;
  flex: 0 0 auto;
  border: 2px solid #c9b495;
  border-top-color: var(--saffron);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.meter {
  flex: 1 1 auto;
  height: 0.35rem;
  min-width: 4.5rem;
  background: #3a2c22;
  border: 1px solid #c9b495;
}

.meter span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--saffron);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .wheel { animation: none; }
}

#viewer:not([hidden]) {
  position: fixed;
  inset: 0;
  z-index: 4;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 0.8rem;
  padding: 1rem;
  background: rgba(26, 18, 12, 0.94);
}

#playback {
  width: min(100%, 64rem);
  max-height: 78vh;
  background: #000;
}

#viewer-note { color: #f4ead7; margin: 0; }

#viewer .quiet { color: #f4ead7; border-color: #f4ead7; }

#cloud { margin: 0; font-size: 1.05rem; line-height: 1.4; max-width: 22rem; }

.diskbox { max-width: 22rem; margin-top: 0.8rem; }

.diskbar {
  height: 0.45rem;
  background: var(--paper-deep);
  border: 1px solid var(--ink);
}

.diskbar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--saffron);
}

#drive, #people, #confirm, #gate, #settings {
  margin-top: 1.6rem;
  max-width: 28rem;
}

#timebox, #unitbox {
  margin-top: 1.6rem;
  max-width: 28rem;
}

#settings { margin-top: 1.4rem; }

form { display: grid; gap: 0.7rem; margin-top: 0.8rem; }

label { display: grid; gap: 0.25rem; font-size: 1rem; }

label.check { display: flex; align-items: center; gap: 0.5rem; }

label.check input { width: auto; }

input, select, textarea {
  font: inherit;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink);
  border-radius: 0;
  padding: 0.55rem 0.6rem;
}

#gate button, #personform button {
  appearance: none;
  width: fit-content;
  background: var(--saffron);
  border: 0;
  color: #1a1008;
  font-family: "Fraunces", serif;
  font-size: 1.4rem;
  padding: 0.7rem 0.9rem;
  cursor: pointer;
}

#personform button { font-family: "Atkinson", sans-serif; font-size: 1rem; background: transparent; border: 1px solid var(--ink); color: var(--ink); }

.eventrow { display: flex; justify-content: space-between; gap: 0.8rem; align-items: center; }

.clip-actions {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.remove {
  appearance: none;
  background: transparent;
  border: 1px solid #7a2e24;
  color: #7a2e24;
  font: inherit;
  padding: 0.35rem 0.5rem;
  cursor: pointer;
}

@media (max-width: 800px) {
  main, .strip { grid-template-columns: 1fr; }
  main {
    grid-template-areas:
      "controls"
      "well"
      "facts";
  }
  h1 { font-size: 3.2rem; }
  video { height: 56vw; min-height: 12rem; }
}
