/* 퍼블리싱 (/partner) — 이 화면에만 쓰는 부품. 색은 sb.css 토큰만 (라이트 · 다크). 디자이너 시안(publishing.html)의 구성을 우리 디자인으로:
 * 어두운 띠 + 게임 영상 첫 화면 · 게임으로 이어온 경험(누적 다운로드 카드 + 대표 게임) · 협업 분야 카드 · 제안 안내 · 3단계 제안 폼 · 질문.
 * 제안 칸(3단계 폼)은 publishing-form.css. 대표 게임 카드의 다운로드 구간 배지(.hit__tier)와 선택 상자(.sel — site.js)는 sb.css. */

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* 머리 — 왼쪽 제목, 넓은 화면은 오른쪽 아래에 설명 */
.pub-head {
  align-items: flex-end;
}
.pub-head__lead {
  max-width: 40ch;
  font-size: clamp(15px, 1.3vw, 17px);
  line-height: 1.7;
  color: var(--ink-2);
}
@media (min-width: 900px) {
  .pub-head__lead {
    text-align: right;
  }
}

/* ---------- 1. 첫 화면 — 어두운 띠(라이트 · 다크 모두 먹색) + 오른쪽 70% 게임 영상, 왼쪽 글 (디자이너 시안처럼) ----------
 * 영상은 site.js video[data-auto] 가 화면 안에서만 튼다 (움직임 줄이기 · 데이터 절약이면 그림만). 영상 왼쪽은 띠 색으로 흐려 글이 읽힌다.
 * 휴대폰 · 좁은 화면(~999px)은 영상이 위, 글이 아래. */
.pub-hero-wrap {
  padding-top: 8px;
}
.pub-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: var(--r-xl);
  background: var(--block-ink);
  color: var(--block-ink-text);
}
.pub-hero__text {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: start;
  gap: 20px;
  padding: 0 clamp(22px, 5vw, 72px) clamp(28px, 5vw, 64px);
}
.pub-hero.is-plain .pub-hero__text {
  padding-top: clamp(28px, 5vw, 72px);
}
.pub-hero .eyebrow {
  color: inherit;
  opacity: 0.8;
  letter-spacing: 0.14em;
}
.pub-hero h1 {
  font-size: clamp(34px, 8.6vw, 64px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.045em;
  text-wrap: balance;
}
.pub-hero__lead {
  max-width: 46ch;
  font-size: clamp(15px, 1.4vw, 18px);
  line-height: 1.75;
  opacity: 0.82;
}
.pub-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}
.pub-cta-icon {
  flex: none;
  width: 18px;
  height: 18px;
  transition: transform var(--dur) var(--ease);
}
.btn:hover .pub-cta-icon {
  transform: translate(2px, -2px);
}
.btn:hover .pub-cta-icon--down {
  transform: translateY(2px);
}
/* 영상 칸 — 좁은 화면은 위쪽 16:9, 아래로 띠 색에 녹아든다 */
.pub-hero__stage {
  position: relative;
  order: -1;
  aspect-ratio: 16 / 9;
}
.pub-hero__media {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--block-ink);
}
.pub-hero__media img,
.pub-hero__media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pub-hero__media video {
  opacity: 0;
  transition: opacity 600ms var(--ease);
}
.pub-hero__media.is-playing video {
  opacity: 1;
}
.pub-hero__media::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, var(--block-ink) 0%, transparent 42%),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.25) 0%, transparent 30%);
}
.pub-hero__caption {
  position: absolute;
  right: clamp(16px, 2.4vw, 28px);
  bottom: clamp(14px, 2.2vw, 26px);
  z-index: 1;
  max-width: calc(100% - 32px);
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.72);
  transition: color var(--dur) var(--ease);
}
.pub-hero__caption:hover {
  color: #fff;
}
.pub-hero__caption:focus-visible {
  border-radius: 4px;
  outline: 2.5px solid var(--focus);
  outline-offset: 3px;
}
@media (max-width: 999px) {
  /* 좁은 화면 — 영상 아래 가장자리(띠 색으로 어두워지는 곳)에 작게. 트레일러 로고는 대개 위 왼쪽이라 피한다 */
  .pub-hero__caption {
    bottom: 10px;
    font-size: 10px;
    letter-spacing: 0.1em;
  }
  /* 이름 줄과 눈썹 글이 붙어 보이지 않게 */
  .pub-hero__text {
    padding-top: 14px;
  }
}
/* 넓은 화면 — 영상이 오른쪽 70% 를 채우고 왼쪽 가장자리는 띠 색으로 흐린다, 글은 그 위 왼쪽 */
@media (min-width: 1000px) {
  .pub-hero {
    flex-direction: row;
    align-items: center;
    min-height: clamp(540px, 42vw, 640px);
  }
  .pub-hero__text {
    width: min(640px, 54%);
    padding: clamp(40px, 5vw, 72px);
  }
  /* 시안처럼 두 줄 — 글 칸 폭에 맞춘다 */
  .pub-hero h1 {
    font-size: clamp(40px, 4.3vw, 64px);
  }
  .pub-hero__stage {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 70%;
    aspect-ratio: auto;
  }
  .pub-hero__media::after {
    background:
      linear-gradient(to right, var(--block-ink) 0%, var(--block-ink) 10%, transparent 60%),
      linear-gradient(to top, var(--block-ink) 0%, transparent 26%),
      linear-gradient(to bottom, var(--block-ink) 0%, transparent 18%);
  }
}

/* ---------- 2. 게임으로 이어온 경험 — 휴대폰은 옆으로 넘기는 줄, 넓은 화면은 4칸 격자 (누적 다운로드 카드가 2칸) ---------- */
.pub-total {
  justify-content: space-between;
}
.pub-total .eyebrow {
  color: inherit;
  opacity: 0.7;
}
/* 카드 폭(cqw — sb.css .card 는 inline-size 컨테이너)에 맞춘다: 1024px 의 두 칸 카드에서 영어 '139M+' 가 옆 숫자와 겹쳤다 */
.pub-total .card__stat .num {
  color: var(--yellow);
  font-size: clamp(44px, 15cqw, 88px);
}
.pub-total__body {
  display: grid;
  gap: 16px;
}
.pub-total__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin: 0;
}
.pub-total__facts > div {
  display: grid;
  gap: 4px;
}
.pub-total__facts dt {
  font-size: 13px;
  font-weight: 700;
  opacity: 0.75;
}
.pub-total__facts dd {
  margin: 0;
  font-size: 30px;
}
@media (min-width: 1000px) {
  .rail.pub-hits {
    grid-auto-flow: row;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow: visible;
    margin-inline: 0;
    padding: 0;
  }
  .pub-total {
    grid-column: span 2;
  }
  /* 두 칸 너비 — 큰 숫자는 왼쪽, 1,000만+ · 설립은 오른쪽 아래 (자리가 모자라면 아래 줄로) */
  .pub-total__body {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px 32px;
  }
  .pub-total__facts {
    gap: 10px 36px;
    padding-bottom: 4px;
  }
  .pub-total__facts dd {
    font-size: clamp(30px, 3vw, 44px);
  }
}

/* ---------- 3. 협업 분야 — 카드 전체가 '이 분야로 제안하기' 링크 ---------- */
.pub-collab {
  display: grid;
  gap: var(--gap);
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 560px) {
  .pub-collab {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 900px) {
  .pub-collab {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.pub-collab > li {
  display: grid;
}
.pub-collab__card {
  position: relative;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: clamp(20px, 2.4vw, 30px);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  transition:
    transform var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}
/* 두 칸 이상이면 한 줄의 카드 높이를 맞춘다 (휴대폰 한 줄은 글 높이만큼) */
@media (min-width: 560px) {
  .pub-collab__card {
    min-height: 236px;
  }
}
.pub-collab__card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-2);
}
.pub-collab__card:focus-visible {
  outline: 2.5px solid var(--focus);
  outline-offset: 3px;
}
.pub-collab__tag {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.pub-collab__icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin: 10px 0 8px;
  border-radius: 16px;
  background: var(--red-soft);
  color: var(--red-text);
}
.pub-collab__icon svg {
  width: 26px;
  height: 26px;
}
.pub-collab__title {
  font-size: clamp(20px, 2vw, 26px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.035em;
}
.pub-collab__line {
  max-width: 34ch;
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink-2);
}
.pub-collab__go {
  position: absolute;
  top: clamp(18px, 2.2vw, 26px);
  right: clamp(18px, 2.2vw, 26px);
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--red-text);
  transition:
    background-color var(--dur) var(--ease),
    color var(--dur) var(--ease);
}
.pub-collab__go .pub-cta-icon {
  width: 18px;
  height: 18px;
}
.pub-collab__card:hover .pub-collab__go {
  background: var(--red);
  color: #fff;
}
.pub-collab__card:hover .pub-cta-icon {
  transform: translate(2px, -2px);
}
/* 마지막 '그 밖의 협업' 은 맺음이라 먹색으로 */
.pub-collab > li:last-child .pub-collab__card {
  background: var(--block-ink);
  color: var(--block-ink-text);
}
.pub-collab > li:last-child .pub-collab__tag,
.pub-collab > li:last-child .pub-collab__line {
  color: inherit;
  opacity: 0.72;
}
.pub-collab > li:last-child .pub-collab__icon {
  background: var(--red);
  color: #fff;
}
.pub-collab > li:last-child .pub-collab__go {
  background: rgba(255, 255, 255, 0.12);
  color: inherit;
}

/* ---------- 4. 제안 안내 — 위 선 + 번호 · 제목 · 설명, 넓은 화면은 세 칸 ---------- */
.pub-guide {
  display: grid;
  gap: clamp(24px, 3vw, 40px);
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 900px) {
  .pub-guide {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.pub-guide__step {
  display: grid;
  align-content: start;
  gap: 10px;
  padding-top: 20px;
  border-top: 2px solid var(--ink);
}
.pub-guide__no {
  font-size: 14px;
  color: var(--red-text);
}
.pub-guide__title {
  font-size: clamp(20px, 2vw, 26px);
  font-weight: 800;
  letter-spacing: -0.035em;
}
.pub-guide__step p {
  max-width: 34ch;
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-2);
}

/* ---------- 6. 제안 전 질문 — 넓은 화면은 가운데 좁은 줄 ---------- */
.pub-faq-wrap .section-head {
  justify-content: center;
  text-align: center;
}
.pub-faq-wrap .section-head__title {
  justify-items: center;
}
.pub-faq {
  max-width: 820px;
  margin: 0 auto;
  border-top: 1px solid var(--line-strong);
}
.pub-faq__item {
  border-bottom: 1px solid var(--line-strong);
}
.pub-faq__item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 16px 4px;
  font-size: clamp(16px, 1.6vw, 19px);
  font-weight: 800;
  letter-spacing: -0.02em;
  list-style: none;
  cursor: pointer;
}
.pub-faq__item summary::-webkit-details-marker {
  display: none;
}
.pub-faq__item summary:focus-visible {
  border-radius: 8px;
  outline: 2.5px solid var(--focus);
  outline-offset: 2px;
}
.pub-faq__icon {
  flex: none;
  width: 22px;
  height: 22px;
  color: var(--red-text);
  transition: transform var(--dur) var(--ease);
}
.pub-faq__item[open] .pub-faq__icon {
  transform: rotate(45deg);
}
.pub-faq__item p {
  max-width: 64ch;
  padding: 0 4px 22px;
  font-size: 15.5px;
  line-height: 1.75;
  color: var(--ink-2);
}

@media (prefers-reduced-motion: reduce) {
  .pub-collab__card,
  .pub-hero__media video {
    transition: none;
  }
}
