.freelance {
  position: relative;
  isolation: isolate;
  margin-block: clamp(38px, 8svh, 95px) 0;
  padding: clamp(15px, 2.7vw, 35px);
  border: 1px solid #7598c7;
  background-color: #1b53a5;
  background-image: linear-gradient(#c9e4fb40 1px, transparent 1px), linear-gradient(90deg, #c9e4fb40 1px, transparent 1px);
  background-size: 28px 28px;
  box-shadow: 6px 8px #0a2b62;
  color: #fcf3d9;
}
.freelance::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 6px;
  border: 1px dashed #8aafdd;
  pointer-events: none;
}
.freelance-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 15px; }
.freelance-heading .pixel-heading { color: #fff4d7; font-size: clamp(33px, 5.6vw, 75px); text-shadow: 3px 4px #112f65; }
.freelance-heading .pixel-heading span {
  font: 900 0.88em/0 "Arial Black", Arial, sans-serif;
  letter-spacing: -0.07em;
  text-transform: uppercase;
}
.freelance-heading p { margin-top: 5px; color: #fff2d2; font-weight: 700; }
.freelance-heading img {
  width: clamp(32px, 6.5vw, 89px);
  height: auto;
  rotate: 13deg;
  filter: drop-shadow(2px 4px 3px #133d74);
}
.freelance-jump {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 35px;
  margin-top: 3px;
  color: #ffda72;
  font-size: 14px;
  font-weight: 700;
  text-underline-offset: 4px;
}
.freelance-browser { position: relative; }
.freelance-platforms, .freelance-categories { display: flex; flex-wrap: wrap; gap: 7px; }
.freelance-platforms { position: relative; z-index: 1; margin-left: 8px; }
.freelance-platforms button, .freelance-categories button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  width: fit-content;
  padding: 6px 18px;
  font-weight: 700;
  line-height: 1.3;
  cursor: pointer;
}
.freelance-platforms button {
  border: 1px solid #80a7df;
  border-radius: 9px 13px 0 0;
  color: #fef3d7;
  background: #143771;
  font-size: clamp(16px, 2vw, 25px);
}
.freelance-platforms button[aria-selected="true"] { color: #591334; border-color: #ff9dc4; background: #ffa7c8; }
.freelance-platforms button:hover:not([aria-selected="true"]) { background: #25529f; }
.freelance-platform-panel {
  padding: clamp(11px, 2.2vw, 25px);
  border: 1px solid #b69c72;
  background: #fff5dc url("assets/paper-grain.webp") repeat;
  color: var(--ink);
  box-shadow: 4px 6px 0 #0c2f68;
}
.freelance-categories { margin-bottom: 14px; }
.freelance-categories button {
  border: 1px solid #788aa9;
  color: #183a76;
  background: #fffbef;
  font-size: 15px;
}
.freelance-categories button[aria-selected="true"] { border-color: #a17629; color: #2c2d3e; background: #ffda74; }
.freelance-categories button:hover:not([aria-selected="true"]) { background: #fff1c9; }
.freelance-results { display: grid; gap: 12px; }
.freelance-results:focus-visible,
.freelance-platform-panel :focus-visible { outline-color: #174fba; }

.freelance-card {
  display: grid;
  grid-template-columns: minmax(0, 0.62fr) minmax(0, 1.75fr);
  align-items: center;
  gap: clamp(14px, 2.4vw, 34px);
  min-width: 0;
  padding: clamp(12px, 2vw, 24px);
  border: 1px solid #baa680;
  background: #fffaf0;
}
.freelance-card h3, .freelance-empty h3 {
  color: #143873;
  font-size: clamp(22px, 2.8vw, 41px);
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.freelance-card p { margin-top: 6px; }
.freelance-visit { margin-top: 13px; }
.freelance-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  align-self: start;
  gap: 8px;
  padding: 0;
  margin: 0;
  min-width: 0;
}
.freelance-gallery.is-single { grid-template-columns: minmax(0, 1fr); }
.freelance-gallery:not(.is-single) > li:first-child { grid-row: span 2; }
.freelance-gallery li { min-width: 0; }
.freelance-shot {
  position: relative;
  display: grid;
  grid-template-rows: 1fr auto;
  width: 100%;
  min-height: 100%;
  min-width: 0;
  border: 1px solid #b49f78;
  padding: 5px;
  background: #fef5de;
  color: #18376c;
  text-align: left;
  cursor: zoom-in;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.freelance-shot:hover { border-color: #2160ac; box-shadow: 2px 3px #d2b98a; }
.freelance-shot-image {
  display: block;
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  align-self: stretch;
  overflow: clip;
  background: #121b2c;
}
.freelance-gallery:not(.is-single) li:first-child .freelance-shot-image { aspect-ratio: auto; }
.freelance-shot img { position: absolute; inset: 0; height: 100%; object-fit: contain; }
.freelance-shot-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 4px 2px 0;
  color: #17396f;
  font-size: 13px;
  font-weight: 700;
}
.freelance-shot-label::after { content: "+"; font: 700 17px/1 sans-serif; color: #144e99; }
.freelance-empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  min-height: 130px;
  padding: clamp(13px, 3vw, 30px);
  border: 1px dashed #8b98ae;
  background: #fffaed;
}
.freelance-empty h3 { font-size: clamp(20px, 2.3vw, 31px); }

html:has(.freelance-lightbox[open]) {
  overflow: hidden;
  scrollbar-gutter: stable;
}
.freelance-lightbox {
  width: min(94%, 1000px);
  max-height: 92svh;
  padding: 0;
  border: 2px solid #8aacd6;
  border-radius: 12px;
  background: #142c51;
  color: #fff4dd;
  box-shadow: 0 12px 40px #060e1eca;
  overscroll-behavior: contain;
}
.freelance-lightbox::backdrop { background: #09182de3; }
.freelance-lightbox-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px clamp(10px, 2vw, 20px);
  border-bottom: 1px solid #4b6c99;
}
.freelance-lightbox-header h3 { font-size: clamp(16px, 2.1vw, 24px); overflow-wrap: anywhere; }
.freelance-close {
  flex: none;
  width: 44px;
  height: 44px;
  border: 1px solid #9fb9da;
  background: #1a3e70;
  color: #fff4da;
  font: 700 26px/1 sans-serif;
  cursor: pointer;
}
.freelance-close:hover { background: #2f5486; }
.freelance-close:focus-visible { outline-color: #ffdc70; }
.freelance-lightbox figure { margin: 0; padding: clamp(8px, 2vw, 19px); }
.freelance-lightbox img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(68svh, calc(92svh - 160px));
  margin-inline: auto;
  object-fit: contain;
}
.freelance-lightbox figcaption { margin-top: 6px; color: #dae5f7; font-size: clamp(12px, 1.35vw, 16px); }

.freelance-videos > header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 3px 16px;
  margin-bottom: 10px;
}
.freelance-videos h3 {
  color: #143873;
  font-size: clamp(18px, 2vw, 27px);
}
.freelance-video-privacy {
  margin-bottom: 12px;
  padding: 7px 10px;
  border-left: 3px solid #7598c7;
  background: #edf3fb;
  color: #18376c;
  font-size: 14px;
  line-height: 1.55;
}
.freelance-video-privacy ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 16px;
  margin: 2px 0 0;
  padding: 0;
}
.freelance-video-privacy a {
  display: inline-block;
  padding-block: 3px;
  font-size: 13px;
  font-weight: 700;
  text-underline-offset: 3px;
}
.freelance-youtube-channel,
.freelance-video-watch {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
  text-underline-offset: 3px;
}
.freelance-video-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 0;
  margin: 0;
}
.freelance-video {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  padding: 5px;
  border: 1px solid #baa680;
  background: #fffaf0;
  color: #18376c;
  text-align: left;
  cursor: pointer;
}
.freelance-video:hover { border-color: #2160ac; box-shadow: 2px 3px #d2b98a; }
.freelance-video-cover {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #142c51;
}
.freelance-video-cover img { width: 100%; height: auto; }
.freelance-video-play, .freelance-video-duration {
  position: absolute;
  color: #fff4dd;
  background: #142c51;
}
.freelance-video-play {
  display: grid;
  place-items: center;
  width: 38px;
  height: 30px;
  border: 1px solid #fff4dd;
  border-radius: 4px;
}
.freelance-video-play::before {
  content: "";
  margin-left: 2px;
  border-block: 6px solid transparent;
  border-left: 9px solid currentColor;
}
.freelance-video-duration {
  right: 4px;
  bottom: 4px;
  padding: 2px 5px;
  font-size: 12px;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}
.freelance-video-title {
  padding: 6px 2px 3px;
  font-weight: 700;
  font-size: clamp(12px, 1.4vw, 16px);
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.freelance-video-note { padding: 0 2px 3px; color: #754322; font-size: 12px; }
.freelance-video-more { margin-top: 13px; }
.freelance-video-more[hidden] { display: none; }
.freelance-player { width: min(94%, 850px); }
.freelance-video-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 200px;
  background: #09182d;
}
.freelance-player-note {
  margin: 0;
  padding: 14px clamp(10px, 2vw, 20px);
  color: #dae5f7;
}
.freelance-video-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}
.freelance-player footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0 18px;
  padding-inline: clamp(10px, 2vw, 20px);
}
.freelance-player footer a { color: #fff4dd; }
.freelance-player footer a:focus-visible { outline-color: #ffdc70; }

@media (prefers-reduced-motion: no-preference) {
  .has-scroll-motion .freelance-browser {
    transform: translateY(calc((1 - var(--freelance-progress, 1)) * 32px))
      rotate(calc((1 - var(--freelance-progress, 1)) * -1.3deg));
  }
  .freelance-gallery li { animation: freelance-deal 330ms ease-out calc(var(--shot, 0) * 45ms) backwards; }
  @keyframes freelance-deal {
    from { transform: translateY(9px) rotate(-1.7deg); opacity: 0.62; }
    to { transform: none; opacity: 1; }
  }
}

@media (max-width: 720px) {
  .freelance-video-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .freelance-card { grid-template-columns: minmax(0, 1fr); }
  .freelance-gallery { grid-auto-rows: auto; }
  .freelance-gallery:not(.is-single) li:first-child { grid-row: auto; grid-column: 1 / -1; }
  .freelance-gallery:not(.is-single) li:first-child .freelance-shot-image { aspect-ratio: 5 / 4; }
}
@media (max-width: 420px) {
  .freelance-heading .pixel-heading { font-size: clamp(25px, 8.6vw, 36px); }
  .freelance { padding-inline: 11px; }
  .freelance-platforms button, .freelance-categories button { padding-inline: 12px; }
  .freelance-card h3 { font-size: 25px; }
  .freelance-card p { font-size: 14px; }
  .freelance-shot { padding: 3px; }
  .freelance-shot-label { font-size: 11px; }
}
