:root {
  color: #f5f3ed;
  background: #07100f;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-synthesis: none;
  --paper: #f4f1e9;
  --ink: #101716;
  --mist: rgb(245 243 237 / 68%);
  --glass: rgb(7 16 15 / 58%);
  --line: rgb(245 243 237 / 20%);
  --sage: #b7cab6;
  --error: #ffb5ab;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: #07100f;
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  background: #07100f;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.nature-backdrop {
  position: fixed;
  z-index: 0;
  inset: 0;
  background:
    linear-gradient(180deg, rgb(1 8 8 / 34%) 0%, rgb(1 8 8 / 8%) 45%, rgb(1 8 8 / 58%) 100%),
    linear-gradient(90deg, rgb(1 8 8 / 48%) 0%, transparent 55%, rgb(1 8 8 / 12%) 100%),
    url("/static/hero-nature.webp") center / cover no-repeat;
  transform: scale(1.015);
}

.nature-backdrop::after {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 35%, transparent 0 18%, rgb(1 8 8 / 36%) 82%);
  content: "";
}

main {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100svh;
}

.view {
  min-height: 100vh;
  min-height: 100svh;
}

.view[hidden],
[hidden] {
  display: none !important;
}

.hero-view {
  display: flex;
  width: min(100%, 820px);
  margin: 0 auto;
  padding: 32px 28px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.compilation-heading h1 {
  margin: 0;
  font-family: "Iowan Old Style", "Baskerville", "Times New Roman", serif;
  font-weight: 400;
  letter-spacing: -0.065em;
}

.compilation-heading em {
  font-weight: 400;
}

#link-form {
  display: grid;
  width: min(100%, 760px);
  justify-items: center;
  gap: 18px;
}

.link-control {
  display: grid;
  width: 100%;
  min-height: 68px;
  padding: 7px 8px 7px 20px;
  border: 1px solid rgb(255 255 255 / 52%);
  border-radius: 20px;
  background: var(--paper);
  box-shadow:
    0 24px 70px rgb(0 0 0 / 28%),
    inset 0 1px 0 rgb(255 255 255 / 80%);
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
}

.link-icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: #7d8581;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

#url {
  width: 100%;
  min-width: 0;
  height: 52px;
  padding: 0;
  border: 0;
  outline: none;
  color: var(--ink);
  background: transparent;
  font-size: 17px;
}

#url::placeholder {
  color: #898f8b;
  opacity: 1;
}

.submit-button {
  display: grid;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #eef2eb;
  background: #1a2623;
  cursor: pointer;
  place-items: center;
  transition:
    transform 160ms ease,
    background-color 160ms ease;
}

.submit-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.submit-button:hover {
  background: #31423d;
  transform: rotate(-4deg);
}

.submit-button:active {
  transform: scale(0.96);
}

.submit-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.passcode-group {
  min-width: 0;
  padding: 0;
  border: 0;
  margin: 0;
}

.passcode-inputs {
  display: flex;
  gap: 7px;
}

.passcode-character {
  width: 45px;
  height: 48px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  color: #f7f5ef;
  background: rgb(7 16 15 / 52%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 8%);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 20px;
  font-weight: 650;
  text-align: center;
  text-transform: lowercase;
  backdrop-filter: blur(14px);
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    box-shadow 160ms ease;
}

.passcode-character:focus {
  border-color: rgb(245 243 237 / 78%);
  background: rgb(17 29 27 / 76%);
  box-shadow: 0 0 0 3px rgb(245 243 237 / 10%);
}

.passcode-group[data-state="checking"] .passcode-character {
  border-color: rgb(183 202 182 / 44%);
}

.passcode-group[data-state="verified"] .passcode-character {
  border-color: rgb(183 202 182 / 82%);
  color: #e9f6e7;
  background: rgb(51 79 65 / 55%);
}

.passcode-group[data-state="invalid"] .passcode-character {
  border-color: rgb(255 181 171 / 72%);
  color: #ffe1dc;
}

.status {
  width: 100%;
  min-height: 22px;
  margin: -5px 4px 0;
  color: rgb(245 243 237 / 68%);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

.status[data-kind="success"] {
  color: #d8ead5;
}

.status[data-kind="error"] {
  color: var(--error);
}

.jump-button,
.back-button,
.create-button {
  border: 0;
  cursor: pointer;
}

.jump-button {
  display: inline-flex;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid rgb(245 243 237 / 34%);
  border-radius: 999px;
  margin-top: 6px;
  align-items: center;
  gap: 10px;
  color: #f5f3ed;
  background: rgb(7 16 15 / 46%);
  font-size: 13px;
  font-weight: 650;
  backdrop-filter: blur(16px);
  transition:
    color 160ms ease,
    background-color 160ms ease,
    transform 160ms ease;
}

.jump-button:hover {
  color: var(--ink);
  background: var(--paper);
  transform: translateY(-2px);
}

.compilation-view {
  display: grid;
  padding: 108px 28px 56px;
  place-items: center;
}

.compilation-card {
  display: grid;
  width: min(100%, 1040px);
  padding: clamp(24px, 5vw, 58px);
  border: 1px solid rgb(245 243 237 / 18%);
  border-radius: 28px;
  background: linear-gradient(145deg, rgb(7 16 15 / 78%), rgb(9 20 18 / 58%));
  box-shadow: 0 36px 110px rgb(0 0 0 / 35%);
  backdrop-filter: blur(26px);
}

.back-button {
  display: inline-flex;
  min-height: 40px;
  padding: 0;
  justify-self: start;
  align-items: center;
  gap: 9px;
  color: rgb(245 243 237 / 64%);
  background: transparent;
  font-size: 13px;
}

.back-button:hover {
  color: #fff;
}

.compilation-heading {
  display: grid;
  margin-top: clamp(36px, 7vw, 74px);
  grid-template-columns: minmax(0, 1.6fr) minmax(220px, 0.7fr);
  align-items: end;
  gap: 42px;
}

.compilation-heading h1 {
  font-size: clamp(48px, 7.5vw, 92px);
  line-height: 0.88;
}

.compilation-heading p {
  margin: 0 0 5px;
  color: var(--mist);
  font-size: 14px;
  line-height: 1.65;
}

.create-button {
  display: flex;
  width: min(100%, 340px);
  min-height: 58px;
  padding: 0 20px;
  border-radius: 16px;
  margin-top: clamp(42px, 6vw, 72px);
  align-items: center;
  justify-content: space-between;
  color: var(--ink);
  background: var(--paper);
  font-size: 14px;
  font-weight: 700;
  transition:
    background-color 160ms ease,
    transform 160ms ease;
}

.create-button:hover {
  background: #fff;
  transform: translateY(-2px);
}

.create-button:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

.compilation-card > .status {
  width: min(100%, 520px);
  text-align: left;
}

.rendered-library {
  padding-top: 34px;
  border-top: 1px solid rgb(245 243 237 / 14%);
  margin-top: 36px;
}

.rendered-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
}

.rendered-heading h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 400;
  letter-spacing: -0.035em;
}

.rendered-heading p {
  margin: 0;
  color: var(--mist);
  font-size: 12px;
}

.recent-runs {
  display: flex;
  margin-top: 24px;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.recent-run-button {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid rgb(245 243 237 / 15%);
  border-radius: 999px;
  flex: 0 0 auto;
  color: rgb(245 243 237 / 66%);
  background: rgb(245 243 237 / 4%);
  font-size: 12px;
}

.recent-run-button[aria-pressed="true"],
.recent-run-button:hover {
  border-color: rgb(245 243 237 / 36%);
  color: var(--ink);
  background: rgb(245 243 237 / 10%);
}

.part-list {
  display: grid;
  margin-top: 14px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.part-button {
  display: grid;
  min-width: 0;
  min-height: 74px;
  padding: 14px;
  border: 1px solid rgb(245 243 237 / 14%);
  border-radius: 14px;
  align-content: space-between;
  gap: 9px;
  color: var(--ink);
  background: rgb(5 11 10 / 40%);
  text-align: left;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    transform 160ms ease;
}

.part-button span {
  font-size: 13px;
  font-weight: 700;
}

.part-button small {
  overflow: hidden;
  color: var(--mist);
  font-size: 10px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.part-button:not(:disabled):hover,
.part-button[aria-pressed="true"] {
  border-color: rgb(245 243 237 / 44%);
  background: rgb(245 243 237 / 12%);
  transform: translateY(-2px);
}

.part-button:disabled {
  cursor: default;
  opacity: 0.42;
}

video {
  width: 100%;
  margin-top: 30px;
  border: 1px solid rgb(245 243 237 / 18%);
  border-radius: 18px;
  background: #000;
  box-shadow: 0 24px 70px rgb(0 0 0 / 42%);
  aspect-ratio: 16 / 9;
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid #f5f3ed;
  outline-offset: 4px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  margin: -1px;
  clip: rect(0, 0, 0, 0);
  overflow: hidden;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .hero-view {
    padding: 24px 18px;
  }

  .link-control {
    min-height: 62px;
    padding-left: 16px;
    border-radius: 18px;
  }

  .submit-button {
    width: 44px;
    height: 44px;
  }

  .passcode-character {
    width: 43px;
  }

  .compilation-view {
    padding: 92px 14px 28px;
  }

  .compilation-card {
    padding: 24px 20px 30px;
    border-radius: 22px;
  }

  .compilation-heading {
    margin-top: 42px;
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .compilation-heading h1 {
    font-size: clamp(48px, 15vw, 72px);
  }

  .create-button {
    width: 100%;
    margin-top: 38px;
  }

  .rendered-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .part-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .full-film-button {
    grid-column: 1 / -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
