/* 포토부스 화면·레이아웃 템플릿과 같은 톤: 검정 바탕 + 은은한 오로라 빛, 굵은 대문자 제목(둘째 줄 외곽선),
   둥근 유리 카드, 알약 버튼(흰 버튼 = 저장, 유리 버튼 = 보조). */
:root {
  --bg: #050506;
  --ink: #ffffff;
  --muted: #9a9aa3;
  --glass: rgba(255, 255, 255, 0.06);
  --glass-line: rgba(255, 255, 255, 0.16);
  --radius: 28px;
  /* 저장 버튼·제목 외곽선 — 프레임 브랜드 키트가 있으면 그 포인트 색으로 바뀐다 (session.js) */
  --primary-bg: var(--ink);
  --primary-ink: #0a0a0c;
  --outline: var(--ink);
  --plate: transparent;
  color-scheme: dark;
}

/* 밝은 테마 (뷰티·패션 브랜드 프레임) */
body.light {
  --bg: #faf8f6;
  --ink: #151417;
  --muted: #6f6b68;
  --glass: rgba(20, 20, 22, 0.035);
  --glass-line: rgba(20, 20, 22, 0.12);
  --primary-bg: var(--ink);
  --primary-ink: #ffffff;
  --outline: var(--ink);
  color-scheme: light;
}

body.light::before {
  background:
    radial-gradient(40% 35% at 15% 10%, rgba(255, 214, 200, 0.55), transparent 70%),
    radial-gradient(45% 40% at 95% 85%, rgba(214, 202, 255, 0.45), transparent 70%),
    radial-gradient(30% 30% at 85% 15%, rgba(200, 240, 226, 0.4), transparent 70%);
}

body.light::after { opacity: 0.04; }
body.light .logo-plate { padding-left: 0; padding-right: 0; } /* 판이 투명하니 여백도 필요 없다 */
body.light .card { box-shadow: 0 30px 60px -36px rgba(60, 40, 30, 0.35); }
body.light .thumb .num, body.light .thumb .size { background: rgba(255, 255, 255, 0.75); color: #151417; }

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
    "Noto Sans KR", "Malgun Gothic", sans-serif;
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  overflow-x: hidden;
}

/* 오로라 빛 + 아주 옅은 필름 그레인 */
body::before {
  content: "";
  position: fixed;
  inset: -20%;
  z-index: -2;
  background:
    radial-gradient(40% 35% at 15% 10%, rgba(76, 52, 180, 0.38), transparent 70%),
    radial-gradient(45% 40% at 95% 85%, rgba(14, 110, 122, 0.32), transparent 70%),
    radial-gradient(30% 30% at 85% 15%, rgba(122, 46, 107, 0.22), transparent 70%);
  filter: blur(20px);
  animation: drift 18s ease-in-out infinite alternate;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.08;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

@keyframes drift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(4%, 3%, 0); }
}

.wrap {
  max-width: 520px;
  margin: 0 auto;
  padding: 0 20px;
}

/* 맨 위: 브랜드 로고 · 행사 이름 · 보관 기한 */
/* 로고가 있으면 그 아래에 행사 이름 (로고 폭·이름 길이와 관계없이 잘리지 않게) */
.brandline {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

/* 행사 이름은 두 줄까지 */
.brandline .eyebrow {
  min-width: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  line-height: 1.35;
}

.logo-plate {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--plate);
}

.logo-plate img {
  display: block;
  height: 26px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
}

.banner {
  display: block;
  width: 100%;
  margin: 18px 0 0;
  border-radius: var(--radius);
  border: 1px solid var(--glass-line);
  animation: rise 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 22px;
  min-height: 56px;
}

.eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.chip {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  white-space: nowrap;
}

/* 굵은 대문자 제목 — 둘째 줄은 외곽선 */
.headline {
  margin: 28px 0 22px;
  font-weight: 900;
  font-size: clamp(56px, 19vw, 96px);
  line-height: 0.92;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.headline .outline {
  display: block;
  color: transparent;
  -webkit-text-stroke: 1.6px var(--outline);
}

/* 사진 카드는 머리(로고·배너·제목) 바로 아래 */
#final { margin-top: 18px; }

.lede {
  margin: 0 0 26px;
  color: var(--muted);
  font-size: 15px;
}

/* 섹션 머리: 작은 대문자 + 줄 */
.label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 34px 0 14px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--glass-line);
}

.label .count { color: var(--muted); font-weight: 600; }

/* 둥근 유리 카드 */
.card {
  background: var(--glass);
  border: 1px solid var(--glass-line);
  border-radius: var(--radius);
  padding: 12px;
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.8);
  animation: rise 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.final, .video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 18px;
  background: #000;
}

/* 알약 버튼 */
.actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.btn {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 54px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid var(--glass-line);
  background: var(--glass);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease;
}

.btn svg { width: 18px; height: 18px; flex: none; }

.btn.primary {
  background: var(--primary-bg);
  border-color: var(--primary-bg);
  color: var(--primary-ink);
}

.btn:active { transform: scale(0.97); }

/* 브랜드 링크 버튼: 저장 버튼 아래, 한 줄에 하나씩 (글자 왼쪽, 화살표 오른쪽) */
.links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 22px;
}

.btn.link {
  flex: none;
  justify-content: space-between;
  text-align: left;
}

.btn.link::after {
  content: "↗";
  font-weight: 800;
  opacity: 0.6;
}

/* 원본 사진 */
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.thumb {
  position: relative;
  display: block;
  border-radius: 18px;
  overflow: hidden;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  color: var(--ink);
  text-decoration: none;
  animation: rise 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.thumb .num {
  position: absolute;
  left: 10px;
  top: 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.thumb .size {
  position: absolute;
  right: 10px;
  bottom: 10px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #e6e6ea;
}

/* 아직 올리는 중 */
.note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 26px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.note::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink);
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.25; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1); }
}

/* 불러오는 중·오류 */
.state {
  padding: 18vh 0 0;
}

.state .ring {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid var(--glass-line);
  border-top-color: var(--ink);
  animation: spin 0.9s linear infinite;
  margin-bottom: 28px;
  visibility: hidden;
}

.state.busy .ring { visibility: visible; }

.state-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}

.state-body { color: var(--muted); margin: 0; }

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

/* 맨 아래: mknw 워드마크만 (회사 사이트와 같은 모양 — 굵은 소문자 + 주황 네모 점) */
.foot {
  display: flex;
  justify-content: center;
  margin: 64px 0 40px;
}

.mknw {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 700;
  font-size: 22px;
  line-height: 1;
  letter-spacing: -0.055em;
  color: var(--ink);
  opacity: 0.9;
}

.mknw-dot {
  display: inline-block;
  width: 0.16em;
  height: 0.16em;
  margin-left: 0.06em;
  background: #e24a22;
}

@media (prefers-reduced-motion: reduce) {
  body::before, .card, .thumb { animation: none; }
  .state .ring { animation-duration: 3s; }
}

[hidden] { display: none !important; }
