/* momoin 홈페이지 스타일.
   흑·백·회색 바탕에 색은 작품 이미지에서만 나오도록 합니다.
   로고·배너·분류 카드·본문·검은 푸터의 바깥 가장자리는 모두 .wrap 의 안쪽 폭(최대 1176px)에 맞춥니다. */

/* ---------- 기본 ---------- */
:root {
  --ink: #171717;
  --muted: #686868;
  --soft: #777;
  --line: #dedede;
  --panel: #f5f5f5;
  --gutter: 32px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", "Microsoft YaHei", Arial, sans-serif;
  font-weight: 400;
  line-height: 1.65;
  letter-spacing: -.15px;
  word-break: keep-all;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: calc(1176px + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.eyebrow,
.kicker {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .14em;
  color: #707070;
}

.btn,
.contact {
  display: inline-block;
  padding: 12px 20px;
  border: 1px solid #222;
  background: #222;
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.btn:hover,
.contact:hover {
  background: #444;
  border-color: #444;
}

.btn.light {
  background: #fff;
  border-color: #d7d7d7;
  color: var(--ink);
}

.btn.light:hover {
  background: #fff;
  border-color: #777;
}

.btn:focus-visible,
.contact:focus-visible {
  outline: 2px solid #111;
  outline-offset: 3px;
}

/* ---------- 헤더: 고양이 마크 + 가는 둥근 서체 momoin, 메뉴, 언어, 문의 ---------- */
.header {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 88px;
  padding: 6px 0;
}

.logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 12px;
  color: #202020;
  text-decoration: none;
}

.brand-mark {
  display: block;
  width: 76px;
  height: 76px;
}

.brand-name {
  font-family: "Quicksand", "Noto Sans KR", sans-serif;
  font-weight: 400;
  font-size: 20px;
  line-height: 1;
  letter-spacing: .04em;
  color: #202020;
}

.nav {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-left: auto;
}

.nav a,
.nav-trigger {
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.nav > a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 6px;
}

/* 넓은 화면에서는 오른쪽 문의 버튼(.contact)을 쓰고, 좁은 화면에서만 메뉴 줄에 표시 */
.nav-contact {
  display: none;
}

.langs {
  display: flex;
  gap: 10px;
}

.langs a {
  color: var(--soft);
  font-size: 11px;
  text-decoration: none;
}

.langs a[aria-current="true"] {
  color: #111;
  font-weight: 700;
}

/* 캐릭터·일러스트 디자인 드롭다운 메뉴 */
.nav-item {
  position: relative;
}

.nav-trigger {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0;
  border: 0;
  background: none;
  font-family: inherit;
  cursor: pointer;
}

.nav-trigger::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform .2s;
}

.has-menu.is-open .nav-trigger::after {
  transform: translateY(1px) rotate(225deg);
}

.nav-menu {
  display: none;
  position: absolute;
  top: calc(100% + 22px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 250px;
  padding: 8px 0;
  background: #fff;
  border: 1px solid #ddd;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .1);
}

/* 메뉴와 버튼 사이 빈 공간에서 hover 가 끊기지 않도록 */
.nav-menu::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -23px;
  height: 23px;
}

.has-menu.is-open .nav-menu {
  display: block;
}

@media (hover: hover) {
  .has-menu:hover .nav-menu {
    display: block;
  }

  .has-menu:hover .nav-trigger::after {
    transform: translateY(1px) rotate(225deg);
  }
}

.nav-group {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav .nav-group li a {
  display: block;
  padding: 10px 22px;
  font-size: 13px;
  font-weight: 500;
  color: #555;
}

.nav .nav-group a:hover,
.nav .nav-group a:focus-visible {
  color: #000;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.nav .nav-group li a[aria-current="page"] {
  color: #000;
  font-weight: 700;
}

/* ---------- 푸터: 본문과 같은 폭의 검은 띠 ---------- */
.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px 24px;
  flex-wrap: wrap;
  margin-top: 6px;
  padding: 18px 24px;
  background: #222;
  color: #fff;
  font-size: 12px;
}

.site-footer nav {
  display: flex;
  gap: 18px;
}

.site-footer a {
  color: #fff;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ---------- 내부 페이지 공통: 제목 줄, 프로젝트 묶음 ---------- */
.section {
  padding: 26px 0 40px;
}

.titleline {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 40px;
  margin-bottom: 28px;
}

.titleline h2 {
  margin: 8px 0 0;
  font-size: 32px;
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: -.04em;
}

.titleline p {
  max-width: 450px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.projects-group {
  margin-top: 56px;
  scroll-margin-top: 16px;
}

.titleline + .projects-group {
  margin-top: 0;
}

.projects-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 30px;
  margin-bottom: 22px;
}

.projects-head h3 {
  margin: 8px 0 0;
  font-size: 24px;
  font-weight: 650;
  letter-spacing: -.03em;
}

.projects-head h3 a {
  color: inherit;
  text-decoration: none;
}

.projects-head p {
  max-width: 440px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.project-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 23px;
}

.project-links a {
  padding-bottom: 5px;
  border-bottom: 1px solid #777;
  color: #222;
  font-size: 13px;
  text-decoration: none;
}

.project-links a::after {
  content: " ↗";
}

.project-links a:hover {
  color: #777;
}

.project-links a:focus-visible {
  outline: 2px solid #333;
  outline-offset: 5px;
}

/* 내부 페이지 하단의 문의 안내 (Pages/Shared/_Inquiry.cshtml) */
.inquiry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 22px;
  margin-top: 48px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.inquiry h2 {
  margin: 0;
  font-size: 21px;
  font-weight: 650;
  line-height: 1.5;
  letter-spacing: -.02em;
}

/* ---------- 작품 이미지: 갤러리, 펼침, 크게 보기 ---------- */
figure {
  margin: 0;
  background: #fff;
  border: 1px solid var(--line);
}

figcaption {
  padding: 13px 16px;
  border-top: 1px solid #eee;
  color: #666;
  font-size: 12px;
}

.image-open {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: #fff;
  cursor: zoom-in;
}

.image-open img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sticker-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.sticker-gallery img {
  height: 330px;
  padding: 16px;
}

.portfolio-details {
  margin-top: 28px;
  border-top: 1px solid #d5d5d5;
}

.portfolio-details summary {
  padding: 20px 0;
  font-size: 14px;
  cursor: pointer;
}

.image-dialog {
  max-width: 95vw;
  max-height: 95vh;
  padding: 16px;
  border: 0;
  background: #fff;
}

.image-dialog::backdrop {
  background: #000b;
}

.image-dialog img {
  display: block;
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
}

.image-dialog button {
  display: block;
  margin: 0 0 12px auto;
  padding: 9px 16px;
  border: 0;
  background: #222;
  color: #fff;
  cursor: pointer;
}

/* ---------- 홈: 상단 배너 (Pages/Index.cshtml, js/carousel.js) ---------- */
.carousel {
  position: relative;
  aspect-ratio: 8 / 3;
  margin-top: 6px;
  overflow: hidden;
  background: #f3f0eb;
}

.carousel-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .2s ease, visibility .2s ease;
}

.carousel-slide.is-current {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.carousel-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.carousel-slide:focus-visible {
  outline: 2px solid #111;
  outline-offset: -4px;
}

.carousel-controls {
  position: absolute;
  left: 5%;
  bottom: 20px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 12px;
}

.carousel-controls button {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #ffffffd9;
  color: #222;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.carousel-controls button:focus-visible {
  outline: 2px solid #111;
  outline-offset: 4px;
}

.carousel-controls .carousel-pause {
  margin-left: 4px;
  font-size: 12px;
}

.carousel-dots {
  display: flex;
  align-items: center;
  gap: 9px;
}

.carousel-dots button {
  width: 7px;
  height: 7px;
  background: #aaa;
  transition: background .2s;
}

.carousel-dots button[aria-current="true"] {
  background: #222;
}

/* ---------- 홈: 사업 요약과 구역 제목 ---------- */
.home-intro {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 14px 0 16px;
}

.home-intro h1 {
  margin: 5px 0;
  font-size: clamp(23px, 2.2vw, 30px);
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: -.045em;
}

.home-intro p {
  margin: 0;
  color: #666;
  font-size: 14px;
  line-height: 1.5;
}

.home-services {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.home-services .btn {
  padding: 13px 17px;
  font-weight: 500;
}

.home-section {
  padding: 16px 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: 8px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 10px;
}

.section-head h2 {
  margin: 0;
  font-size: 23px;
  font-weight: 650;
  line-height: 1.4;
  letter-spacing: -.03em;
}

.section-number {
  color: #737373;
  font-family: Arial, sans-serif;
  font-size: 9px;
  letter-spacing: 1.6px;
}

/* ---------- 홈: 분류 카드 3장 (이미지 4:3, 가운데 기준으로 잘라 채움) ---------- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.cat-card {
  display: block;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
}

.cat-card:focus-visible {
  outline: 2px solid #111;
  outline-offset: 4px;
}

.cat-picture {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #f4f4f4;
}

.cat-picture img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform .25s ease;
}

.cat-card:hover .cat-picture img {
  transform: scale(1.025);
}

.cat-info {
  padding-top: 8px;
}

.cat-info small {
  color: #818181;
  font-size: 10px;
  letter-spacing: .09em;
}

.cat-info h3 {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin: 3px 0 0;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
}

.cat-info h3 span:last-child {
  color: #8a8a8a;
  font-size: 13px;
}

/* ---------- 홈: App·웹 개발 카드 (Pages/Shared/_InterfaceMock.cshtml — 화면 구성 예시) ---------- */
.digital-showcase {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.digital-case {
  display: block;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
  transition: opacity .2s;
}

.digital-case:hover {
  opacity: .86;
}

.digital-case:focus-visible {
  outline: 2px solid #111;
  outline-offset: 4px;
}

.interface-frame {
  padding: 15px 15px 0;
  overflow: hidden;
  background: #e9ecf0;
  font-family: Arial, sans-serif;
  letter-spacing: 0;
}

.interface-frame.calculator {
  background: #eeeeea;
}

.browser-top {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 25px;
  padding: 0 10px;
  border: 1px solid #d9dce1;
  border-bottom-color: #ececec;
  border-radius: 5px 5px 0 0;
  background: #fff;
}

.browser-top i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ccc;
}

.browser-top span {
  margin: auto;
  padding-right: 25px;
  color: #999;
  font-size: 8px;
}

.mini-ui,
.calc-ui,
.plain-ui {
  height: 232px;
  border: 1px solid #d9dce1;
  border-top: 0;
  border-bottom: 0;
  background: #fff;
}

.mini-ui {
  display: grid;
  grid-template-columns: 95px minmax(0, 1fr);
  background: #fafbfd;
}

.mini-ui aside {
  display: flex;
  flex-direction: column;
  gap: 19px;
  padding: 20px 12px;
  border-right: 1px solid #eee;
  background: #fff;
}

.mini-ui aside b {
  margin-bottom: 5px;
  font-size: 13px;
  letter-spacing: -.4px;
}

.mini-ui aside span {
  color: #888;
  font-size: 8px;
}

.mini-ui aside span:first-of-type {
  color: #333;
  font-weight: 700;
}

.mini-canvas {
  min-width: 0;
  padding: 17px;
}

.ui-heading {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
}

.ui-search,
.calc-search {
  display: flex;
  justify-content: space-between;
  margin: 12px 0;
  padding: 10px;
  border: 1px solid #e2e4e7;
  background: #fff;
  color: #999;
  font-size: 8px;
}

.ui-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.ui-tiles div {
  padding: 10px;
  border: 1px solid #e5e7eb;
  background: #fff;
}

.ui-tiles small {
  display: block;
  margin-bottom: 8px;
  color: #999;
  font-size: 6px;
  letter-spacing: .5px;
}

.ui-tiles b {
  font-size: 11px;
  font-weight: 500;
}

.ui-chart {
  height: 88px;
  margin-top: 10px;
  padding: 10px;
  overflow: hidden;
  border: 1px solid #e6e6e6;
  background: #fff;
}

.ui-chart span {
  color: #777;
  font-size: 8px;
}

.ui-chart svg {
  display: block;
  width: 100%;
  height: 54px;
}

.calc-ui {
  padding: 18px 28px;
}

.calc-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.calc-top b {
  font-size: 16px;
  letter-spacing: -.7px;
}

.calc-top span {
  color: #888;
  font-size: 7px;
}

.calc-title {
  margin-top: 28px;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -.7px;
  text-align: center;
}

.calc-search {
  max-width: 280px;
  margin: 15px auto;
}

.calc-tools {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 18px;
}

.calc-tools div {
  padding: 10px 4px;
  border: 1px solid #e9e9e5;
  background: #f6f6f3;
  text-align: center;
}

.calc-tools b {
  display: block;
  margin-bottom: 7px;
  font-size: 16px;
  font-weight: 400;
}

.calc-tools span {
  color: #777;
  font-size: 8px;
}

.plain-ui {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  padding: 24px 28px;
}

.plain-ui b {
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -1px;
}

.plain-ui span {
  color: #666;
  font-size: 12px;
}

.digital-caption {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-top: 9px;
}

.digital-caption h3 {
  margin: 0 0 4px;
  font-family: Arial, sans-serif;
  font-size: 22px;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -.7px;
}

.digital-caption b {
  font-size: 12px;
  font-weight: 500;
}

.digital-caption p {
  margin: 4px 0 0;
  color: var(--soft);
  font-size: 13px;
  line-height: 1.55;
}

.case-arrow {
  color: #555;
  font-size: 22px;
  line-height: 1.3;
}

.interface-note {
  margin: 8px 0 0;
  color: #888;
  font-size: 10px;
  text-align: right;
}

/* ---------- 홈: 작업 프로세스 (연회색 바탕, 선으로 그린 네 단계) ---------- */
.process {
  padding: 32px 36px 34px;
  background: var(--panel);
}

.process-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 22px;
  margin-bottom: 25px;
}

.process-heading .eyebrow {
  display: block;
  margin-bottom: 5px;
  font-size: 10px;
  letter-spacing: 1.6px;
}

.process-heading h2 {
  margin: 0;
  font-size: 23px;
  font-weight: 650;
  line-height: 1.4;
  letter-spacing: -.03em;
}

.process-heading p {
  max-width: 360px;
  margin: 0;
  color: var(--soft);
  font-size: 13px;
  line-height: 1.7;
  text-align: right;
}

.process-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 26px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.process-steps li {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 13px;
  text-align: center;
}

/* 단계 사이의 가는 화살표 */
.process-steps li:not(:last-child)::after {
  content: "›";
  position: absolute;
  top: 33px;
  right: -19px;
  color: #bbb;
  font-size: 24px;
  line-height: 1;
}

.process-art {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 108px;
  height: 96px;
  color: #555;
}

/* 그림 뒤의 옅은 흰색 바탕: 단계마다 모양과 기울기를 조금씩 다르게 */
.process-art::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 48% 52% 53% 47%;
  background: #ffffffa6;
  transform: rotate(-3deg);
}

.process-steps li:nth-child(2) .process-art::before {
  border-radius: 54% 46% 47% 53%;
  transform: rotate(3deg);
}

.process-steps li:nth-child(3) .process-art::before {
  border-radius: 46% 54% 51% 49%;
  transform: rotate(-2deg);
}

.process-steps li:nth-child(4) .process-art::before {
  transform: rotate(2deg);
}

.process-index {
  position: absolute;
  left: 0;
  top: 0;
  color: #888;
  font-size: 10px;
  letter-spacing: 1px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.process-drawing {
  position: relative;
  display: block;
  width: 70px;
  height: 70px;
  stroke-width: 1.7;
}

/* 상자 위의 완료 표시: 뒤쪽 선을 가리도록 바탕색으로 채움 */
.process-badge {
  fill: #fbfbfb;
}

.process-steps h3 {
  margin: 0 0 7px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
}

.process-steps p {
  max-width: 195px;
  margin: 0 auto;
  color: var(--soft);
  font-size: 12px;
  line-height: 1.75;
}

/* ---------- 홈: 프로젝트 문의 (한 곳에만 둡니다) ---------- */
.home-cta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 22px;
  padding: 22px 0 20px;
}

.home-cta h2 {
  margin: 0 0 4px;
  font-size: 21px;
  font-weight: 650;
  line-height: 1.5;
  letter-spacing: -.02em;
}

.home-cta p {
  margin: 0;
  color: var(--soft);
  font-size: 12px;
}

.home-cta .btn {
  padding: 12px 22px;
}

/* ---------- App·웹 개발 (Pages/Digital.cshtml) ---------- */
.digital-cases {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.digital-cases article {
  display: grid;
  grid-template-columns: 45% 55%;
  min-height: 280px;
  border: 1px solid var(--line);
  background: #fff;
  scroll-margin-top: 16px;
}

.project-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #f0f0f0;
}

.browser-line {
  position: absolute;
  top: 15px;
  left: 15px;
  right: 15px;
  height: 12px;
  border-bottom: 1px solid #c9cecf;
}

.brand-panel {
  padding: 22px;
  text-align: left;
}

.brand-panel b {
  display: block;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -1px;
}

.brand-panel span {
  display: block;
  margin-top: 12px;
  color: #555;
  font-size: 12px;
}

.brand-panel small {
  display: block;
  margin-top: 28px;
  color: #777;
  font-size: 11px;
}

.project-content {
  padding: 32px 25px;
}

.project-content small {
  color: #78817c;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
}

.project-content h3 {
  margin: 16px 0 12px;
  font-size: 23px;
  font-weight: 650;
  letter-spacing: -.03em;
}

.project-content p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

/* ---------- 회사소개 (Pages/About.cshtml) ---------- */
.about-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.about-panel {
  display: block;
  padding: 28px 30px 32px;
  background: var(--panel);
  color: var(--ink);
  text-decoration: none;
}

.about-panel:hover {
  background: #efefef;
}

.about-panel small {
  color: #737373;
  font-family: Arial, sans-serif;
  font-size: 9px;
  letter-spacing: 1.6px;
}

.about-panel h3 {
  margin: 12px 0 10px;
  font-size: 24px;
  font-weight: 650;
  letter-spacing: -.03em;
}

.about-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

/* ---------- 프로젝트 문의 (Pages/Contact.cshtml, js/contact.js) ---------- */
.contact-form {
  display: grid;
  gap: 20px;
  max-width: 800px;
}

.contact-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.contact-form label {
  display: block;
  font-size: 14px;
}

.contact-form label span {
  display: block;
  margin-bottom: 8px;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  display: block;
  width: 100%;
  padding: 13px 14px;
  border: 1px solid #cfcfcf;
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
}

.contact-form textarea {
  resize: vertical;
}

.contact-form input:focus-visible,
.contact-form select:focus-visible,
.contact-form textarea:focus-visible {
  outline: 2px solid #111;
  outline-offset: 1px;
}

.contact-form > .btn {
  justify-self: start;
}

.contact-note {
  margin: -10px 0 0;
  color: var(--soft);
  font-size: 12px;
}

.contact-output pre {
  margin: 0 0 14px;
  padding: 18px 20px;
  background: var(--panel);
  font: inherit;
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-word;
}

.contact-output [role="status"] {
  margin-left: 12px;
  color: var(--soft);
  font-size: 12px;
}

/* ---------- 좁은 화면 ---------- */
@media (max-width: 1000px) {
  .digital-cases {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 800px) {
  :root {
    --gutter: 18px;
  }

  .header {
    flex-wrap: wrap;
    gap: 10px 16px;
    min-height: 0;
    padding: 10px 0 12px;
  }

  .brand-mark {
    width: 56px;
    height: 56px;
  }

  .brand-name {
    font-size: 17px;
  }

  .langs {
    margin-left: auto;
  }

  .header .contact {
    display: none;
  }

  .nav {
    order: 3;
    flex-wrap: wrap;
    gap: 8px 18px;
    width: 100%;
    margin: 0;
  }

  .nav a,
  .nav-trigger {
    font-size: 12px;
  }

  .nav-contact {
    display: inline;
  }

  .has-menu {
    position: static;
  }

  .nav-menu {
    top: 100%;
    left: 0;
    right: 0;
    transform: none;
    min-width: 0;
  }

  .nav-menu::before {
    display: none;
  }

  .section {
    padding: 18px 0 32px;
  }

  .titleline {
    display: block;
    margin-bottom: 22px;
  }

  .titleline h2 {
    font-size: 26px;
  }

  .titleline p {
    margin-top: 12px;
  }

  .projects-group {
    margin-top: 44px;
  }

  .projects-head {
    display: block;
  }

  .projects-head h3 {
    font-size: 21px;
  }

  .projects-head p {
    margin-top: 12px;
  }

  .sticker-gallery {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .sticker-gallery img {
    height: 250px;
  }

  .carousel-controls {
    left: 4%;
    bottom: 8px;
    gap: 8px;
  }

  .carousel-controls button {
    width: 24px;
    height: 24px;
    font-size: 16px;
  }

  .carousel-controls .carousel-pause {
    font-size: 10px;
  }

  .carousel-dots {
    gap: 7px;
  }

  .carousel-dots button {
    width: 6px;
    height: 6px;
  }

  .home-intro {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0 14px;
  }

  .home-section {
    padding: 14px 0;
  }

  .digital-showcase {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .calc-ui {
    padding: 18px 16px;
  }

  .interface-note {
    text-align: left;
  }

  .process {
    padding: 26px 24px 29px;
  }

  .process-heading {
    display: block;
    margin-bottom: 23px;
  }

  .process-heading p {
    max-width: none;
    margin-top: 8px;
    text-align: left;
  }

  .process-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 16px;
  }

  .process-steps li:not(:last-child)::after {
    display: none;
  }

  .home-cta {
    padding: 20px 0 18px;
  }

  .inquiry {
    margin-top: 36px;
  }

  .digital-cases article {
    min-height: 0;
  }

  .brand-panel {
    padding: 34px 14px 20px;
  }

  .brand-panel b {
    font-size: 21px;
  }

  .project-content {
    padding: 24px 18px;
  }

  .project-content h3 {
    font-size: 20px;
  }

  .about-panels {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .about-panel {
    padding: 22px 22px 26px;
  }

  .about-panel h3 {
    font-size: 21px;
  }
}

@media (max-width: 600px) {
  .section-head h2 {
    font-size: 21px;
  }

  .section-number {
    display: none;
  }

  .cat-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .contact-pair {
    grid-template-columns: 1fr;
  }

  .home-cta,
  .inquiry {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .carousel-slide,
  .cat-picture img,
  .digital-case {
    transition: none;
  }

  .cat-card:hover .cat-picture img {
    transform: none;
  }
}

/* ---------- 그림책 서브페이지: 전자책 미리보기 (Pages/Books.cshtml, js/flipbook.js) ---------- */

.books-page {
  background: #fff;
}

.flipbook {
  background: #fff;
  border: 1px solid #dedede;
  padding: 32px 40px 28px;
}

.fb-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 24px;
}

.fb-head h3 {
  font-size: 26px;
  letter-spacing: -.03em;
  margin: 0;
}

.fb-head span {
  font-size: 13px;
  color: #686868;
  white-space: nowrap;
}

/* 원목 책상 상판: 위에서부터 조명 → 원목 사진(images/books/wood-desk.jpg, 결이 가로로 흐르도록 눕힌 것) → 바탕색 */
.fb-stage {
  perspective: 2600px;
  padding: 56px 64px 64px;
  overflow: hidden;
  border-radius: 6px;
  background:
    radial-gradient(ellipse 90% 70% at 28% 0, rgba(255, 238, 205, .3), rgba(255, 238, 205, 0) 70%),
    url("../images/books/wood-desk.jpg") center / cover no-repeat,
    #b06f33;
  box-shadow:
    inset 0 0 0 1px rgba(60, 30, 10, .35),
    inset 0 1px 0 1px rgba(255, 236, 205, .28),
    inset 0 0 90px rgba(45, 20, 5, .3);
}

.fb-book {
  position: relative;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  aspect-ratio: var(--ratio);
  transition: transform .7s cubic-bezier(.645, .045, .355, 1);
  cursor: pointer;
  outline: none;
  touch-action: pan-y;
  user-select: none;
}

/* 덮인 상태에서는 보이는 한 면이 가운데 오도록 이동 */
.fb-book.is-closed-front {
  transform: translateX(-25%);
}

.fb-book.is-closed-back {
  transform: translateX(25%);
}

.fb-book:focus-visible {
  outline: 2px solid #333;
  outline-offset: 6px;
}

.fb-leaf {
  position: absolute;
  top: 0;
  left: 50%;
  width: 50%;
  height: 100%;
  transform-origin: left center;
  transform-style: preserve-3d;
  transition: transform .9s cubic-bezier(.645, .045, .355, 1);
}

.fb-leaf.is-flipped {
  transform: rotateY(-180deg);
}

.fb-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background-color: #fff;
  background-repeat: no-repeat;
  overflow: hidden;
  /* 책상 위에 놓인 책: 바닥에 붙은 짙은 그림자 + 넓게 퍼지는 그림자 */
  box-shadow:
    0 1px 2px rgba(40, 18, 4, .16),
    0 12px 22px rgba(40, 18, 4, .08);
}

.fb-back {
  transform: rotateY(180deg);
}

/* 펼침면 한 장을 반씩 잘라 왼쪽·오른쪽 면으로 사용 */
.fb-half {
  background-size: 200% 100%;
}

.fb-half.fb-left {
  background-position: left center;
}

.fb-half.fb-right {
  background-position: right center;
}

/* 제본선 그림자 */
.fb-half.fb-right::after,
.fb-half.fb-left::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 12%;
  pointer-events: none;
}

.fb-half.fb-right::after {
  left: 0;
  background: linear-gradient(to right, rgba(0, 0, 0, .18), rgba(0, 0, 0, 0));
}

.fb-half.fb-left::after {
  right: 0;
  background: linear-gradient(to left, rgba(0, 0, 0, .18), rgba(0, 0, 0, 0));
}

/* 넘기는 동안 책장에 드리우는 음영 */
.fb-leaf.is-moving .fb-face::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  animation: fb-shade .9s ease-in-out;
}

@keyframes fb-shade {
  0%, 100% { background: rgba(0, 0, 0, 0); }
  50% { background: rgba(0, 0, 0, .14); }
}

.fb-cover {
  background: #222629;
  border-radius: 0 6px 6px 0;
}

.fb-cover-art {
  position: absolute;
  inset: 0;
  background-size: 200% 100%;
  background-position: right center;
}

/* 전용 표지 이미지: 비율 그대로 채움 + 제본 쪽 음영 */
.fb-cover-art.is-image {
  background-size: cover;
  background-position: center;
}

.fb-cover-art.is-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    rgba(0, 0, 0, .2) 0,
    rgba(0, 0, 0, .06) 2%,
    rgba(255, 255, 255, .18) 3%,
    rgba(255, 255, 255, 0) 5.5%);
  pointer-events: none;
}

.fb-cover-title {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px 22px 22px;
  background: rgba(255, 255, 255, .94);
}

.fb-cover-title small {
  display: block;
  font-size: 10px;
  letter-spacing: 1.5px;
  color: #686868;
  font-weight: 800;
}

.fb-cover-title b {
  display: block;
  margin-top: 8px;
  font-size: clamp(16px, 2.2vw, 26px);
  letter-spacing: -.03em;
  line-height: 1.3;
}

.fb-backcover {
  background: #f0f0f0;
  border-radius: 6px 0 0 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: #555;
  font-size: 13px;
  text-align: center;
  padding: 24px;
}

.fb-backcover img {
  width: 34%;
  max-width: 130px;
  height: auto;
}

.fb-backcover .brand-name {
  font-size: clamp(15px, 1.8vw, 20px);
  margin-bottom: 4px;
}

.fb-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 26px;
  flex-wrap: wrap;
}

.fb-controls button {
  border: 1px solid #222629;
  background: #222629;
  color: #fff;
  padding: 11px 20px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.fb-controls button:disabled {
  opacity: .3;
  cursor: default;
}

.fb-controls .fb-restart {
  background: #fff;
  color: #222629;
  border-color: #d6d9da;
}

.fb-status {
  min-width: 90px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.fb-hint {
  text-align: center;
  font-size: 12px;
  color: #686868;
  margin: 14px 0 0;
}

/* ---------- 두루마리(장권) 그림책 (Pages/Shared/_ScrollViewer.cshtml, js/scroll.js) ---------- */
.scroll-viewer {
  --roller: 26px;
  --open-ms: 1.8s;
  background: #fff;
  border: 1px solid #dedede;
  padding: 32px 40px 28px;
}

.scroll-frame {
  position: relative;
  height: clamp(300px, 60vh, 620px);
  margin: 0 auto;
}

/* 펼쳐지는 본체: 닫히면 폭 0(양쪽 축이 맞붙음), 열리면 양쪽 끝까지 */
.scroll-body {
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 50%;
  width: 0;
  transform: translateX(-50%);
  transition: width var(--open-ms) cubic-bezier(.65, 0, .35, 1);
}

.scroll-viewer.is-open .scroll-body {
  width: calc(100% - var(--roller) * 2);
}

/* 비단 표구: 위아래 테두리 + 종이 */
.scroll-window {
  position: absolute;
  inset: 0;
  overflow: hidden;
  padding: 12px 0;
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .08) 0 6px, rgba(0, 0, 0, .04) 6px 12px),
    #b7a07a;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .18);
  outline: none;
  cursor: default;
  user-select: none;
  scrollbar-width: none;
}

.scroll-window::-webkit-scrollbar {
  display: none;
}

.scroll-viewer.is-open .scroll-window {
  overflow-x: auto;
  cursor: grab;
}

.scroll-viewer.is-dragging .scroll-window {
  cursor: grabbing;
}

.scroll-viewer.is-animating .scroll-window {
  overflow-x: hidden;
}

.scroll-window:focus-visible {
  outline: 2px solid #333;
  outline-offset: 4px;
}

.scroll-track {
  display: flex;
  height: 100%;
  width: max-content;
  background: #f4ecda;
  border-top: 2px solid #8c7552;
  border-bottom: 2px solid #8c7552;
}

.scroll-track img {
  display: block;
  height: 100%;
  width: auto;
  flex: none;
  margin-right: -1px; /* 타일 경계선 틈 방지 */
  pointer-events: none;
}

/* 나무 축: 결무늬가 돌아가는 애니메이션으로 말리고 풀리는 느낌 */
.scroll-roller {
  position: absolute;
  top: -14px;
  bottom: -14px;
  width: var(--roller);
  border-radius: 6px;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, .45), rgba(255, 255, 255, .28) 38%, rgba(0, 0, 0, .1) 60%, rgba(0, 0, 0, .5)),
    repeating-linear-gradient(90deg, #6e4322 0 3px, #8a5a31 3px 8px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, .25);
  z-index: 2;
}

.scroll-roller.is-left {
  left: calc(var(--roller) * -1);
}

.scroll-roller.is-right {
  right: calc(var(--roller) * -1);
}

/* 축 끝 손잡이 */
.scroll-roller::before,
.scroll-roller::after {
  content: "";
  position: absolute;
  left: 50%;
  width: calc(var(--roller) + 10px);
  height: 12px;
  transform: translateX(-50%);
  border-radius: 4px;
  background: linear-gradient(90deg, #2d1a0c, #6a4524 45%, #2d1a0c);
}

.scroll-roller::before {
  top: -8px;
}

.scroll-roller::after {
  bottom: -8px;
}

.scroll-viewer.is-animating .scroll-roller.is-left {
  animation: scroll-spin-left .35s linear infinite;
}

.scroll-viewer.is-animating .scroll-roller.is-right {
  animation: scroll-spin-right .35s linear infinite;
}

@keyframes scroll-spin-left {
  to { background-position: 0 0, -16px 0; }
}

@keyframes scroll-spin-right {
  to { background-position: 0 0, 16px 0; }
}

/* 닫혀 있을 때 보이는 제목 띠(题签) */
.scroll-tag {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-width: 260px;
  padding: 22px 22px 18px;
  border: 1px solid #c9b48a;
  border-radius: 2px;
  background: #f6efdd;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .18);
  color: #3a2c1a;
  font: inherit;
  cursor: pointer;
  transition: opacity .4s, transform .4s;
}

.scroll-tag b {
  font-size: 17px;
  line-height: 1.45;
  letter-spacing: -.02em;
}

.scroll-tag span {
  font-size: 12px;
  font-weight: 700;
  color: #8c6a3a;
}

.scroll-tag span::after {
  content: " →";
}

.scroll-viewer.is-open .scroll-tag {
  opacity: 0;
  transform: translate(-50%, -40%);
  pointer-events: none;
}

.scroll-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 900px;
  margin: 28px auto 0;
}

.scroll-controls button,
.scroll-actions button {
  flex: none;
  border: 1px solid #222629;
  background: #222629;
  color: #fff;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.scroll-controls button {
  width: 44px;
  height: 44px;
}

.scroll-minimap {
  position: relative;
  flex: 1;
  min-width: 0;
  cursor: pointer;
  touch-action: none;
  opacity: .45;
  transition: opacity .4s;
}

.scroll-viewer.is-open .scroll-minimap {
  opacity: 1;
}

.scroll-minimap img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 2px;
  pointer-events: none;
}

.mm-window {
  position: absolute;
  top: -3px;
  bottom: -3px;
  left: 0;
  width: 10%;
  border: 2px solid #222629;
  border-radius: 3px;
  box-shadow: 0 0 0 9999px rgba(255, 255, 255, .45);
  pointer-events: none;
}

.scroll-minimap {
  overflow: hidden;
  padding: 3px 0;
}

.scroll-actions {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

.scroll-actions button {
  padding: 11px 22px;
  background: #fff;
  color: #222629;
  border-color: #d6d9da;
}

.shelf-cover.is-image {
  background-size: cover;
  background-position: center;
}

@media (max-width: 800px) {
  .scroll-viewer {
    --roller: 18px;
    padding: 20px 12px;
  }

  .scroll-frame {
    height: clamp(260px, 52vh, 420px);
  }

  .scroll-controls button {
    width: 38px;
    height: 38px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-body,
  .scroll-tag {
    transition: none;
  }

  .scroll-viewer.is-animating .scroll-roller {
    animation: none;
  }
}

/* ---------- 숨은 그림 찾기 (Pages/Shared/_FindGame.cshtml) ---------- */
.find-game {
  margin-top: 24px;
  background: #fff;
  border: 1px solid #dedede;
  padding: 32px 40px 36px;
}

.find-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 32px;
  margin-bottom: 24px;
}

.find-head h3 {
  font-size: 26px;
  letter-spacing: -.03em;
  margin: 10px 0 8px;
}

.find-head p {
  margin: 0;
  max-width: 520px;
  font-size: 14px;
  line-height: 1.7;
  color: #686868;
}

.find-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: none;
}

.find-progress {
  width: 180px;
  height: 8px;
  border-radius: 4px;
  background: #ececec;
  overflow: hidden;
}

.find-bar {
  display: block;
  height: 100%;
  width: 0;
  background: #222629;
  border-radius: 4px;
  transition: width .3s;
}

.find-total {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.find-total b {
  font-size: 20px;
}

.find-reset {
  border: 1px solid #d6d9da;
  background: #fff;
  color: #222629;
  border-radius: 4px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.find-done {
  margin: 0 0 20px;
  padding: 14px 18px;
  background: #222629;
  color: #fff;
  font-weight: 700;
  text-align: center;
  border-radius: 4px;
}

.find-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}

.find-card {
  position: relative;
  border: 1px solid #e3e3e3;
  border-radius: 6px;
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
}

.find-card:hover {
  border-color: #b9b9b9;
}

.find-card.is-complete {
  border-color: #222629;
  box-shadow: 0 0 0 1px #222629;
}

.find-card.is-pop {
  animation: find-pop .3s ease-out;
}

@keyframes find-pop {
  50% { transform: scale(1.04); }
}

.find-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 14px 10px 14px;
  border: 0;
  background: none;
  font: inherit;
  color: #202020;
  cursor: pointer;
}

.find-add img {
  width: 100%;
  max-width: 120px;
  aspect-ratio: 1;
  object-fit: contain;
  transition: opacity .2s;
}

.find-card.is-complete .find-add img {
  opacity: .55;
}

.find-add b {
  margin-top: 8px;
  font-size: 14px;
  text-align: center;
  line-height: 1.35;
}

.find-num {
  margin-top: 4px;
  font-size: 13px;
  color: #686868;
  font-variant-numeric: tabular-nums;
}

.find-num i {
  font-style: normal;
  font-weight: 800;
  color: #202020;
}

.find-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  margin-top: 8px;
}

.find-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid #c9c9c9;
}

.find-dots span.is-on {
  background: #222629;
  border-color: #222629;
}

/* 다 찾은 카드에 체크 표시 */
.find-card.is-complete::after {
  content: "";
  position: absolute;
  top: 10px;
  left: 10px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #222629 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center / 14px no-repeat;
  pointer-events: none;
}

.find-undo {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border: 1px solid #d6d9da;
  border-radius: 50%;
  background: #fff;
  color: #555;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.find-undo:disabled {
  visibility: hidden;
}

@media (max-width: 1100px) {
  .find-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 800px) {
  .find-game {
    padding: 22px 14px 26px;
  }

  .find-head {
    display: block;
  }

  .find-summary {
    margin-top: 16px;
  }

  .find-progress {
    flex: 1;
    width: auto;
  }

  .find-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}

/* ---------- 늘어나는 병풍책 (Pages/Shared/_PullStrip.cshtml, js/pull.js) ---------- */
.pull-book {
  background: #fff;
  border: 1px solid #dedede;
  padding: 32px 40px 28px;
}

.pull-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.pull-toolbar button {
  padding: 9px 16px;
  border: 1px solid #d6d9da;
  border-radius: 999px;
  background: #fff;
  color: #222629;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.pull-toolbar button:hover {
  border-color: #222629;
}

.pull-stage {
  position: relative;
  transition: transform .26s ease-in, opacity .26s;
}

.pull-stage.is-flipping {
  transform: perspective(1200px) rotateY(80deg);
  opacity: 0;
}

.pull-strip[hidden],
.pull-back[hidden] {
  display: none;
}

/* 병풍처럼 칸이 이어진 긴 띠 */
.pull-strip {
  display: flex;
  gap: 0;
  padding: 64px 4px 4px;   /* 위로 당겨지는 공간 */
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}

.pull-panel {
  --p: 0;
  position: relative;
  flex: 1 0 128px;
  margin: 0;
  scroll-snap-align: start;
  cursor: grab;
  touch-action: none;
  user-select: none;
  outline: none;
  transform: translateY(calc(var(--p) * -14px));
}

.pull-panel.is-dragging {
  cursor: grabbing;
}

.pull-panel:focus-visible .pull-window {
  outline: 3px solid #222629;
  outline-offset: 2px;
}

/* 당기는 손잡이 (종이 탭) */
.pull-tab {
  position: absolute;
  left: 50%;
  top: -30px;
  z-index: 2;
  width: 46px;
  height: 34px;
  transform: translateX(-50%) translateY(calc(var(--p) * -10px));
  border-radius: 10px 10px 4px 4px;
  background: #ffcf4a;
  box-shadow: 0 3px 0 #d9a520, 0 6px 12px rgba(0, 0, 0, .15);
}

.pull-tab span {
  position: absolute;
  left: 50%;
  top: 9px;
  width: 12px;
  height: 12px;
  border-left: 3px solid #6b4a00;
  border-top: 3px solid #6b4a00;
  transform: translateX(-50%) rotate(45deg);
  animation: pull-nudge 1.4s ease-in-out infinite;
}

.pull-panel.is-open .pull-tab span {
  animation: none;
  transform: translateX(-50%) translateY(4px) rotate(225deg);
}

@keyframes pull-nudge {
  0%, 100% { margin-top: 2px; }
  50% { margin-top: -3px; }
}

.pull-window {
  position: relative;
  aspect-ratio: 350 / 1050;
  overflow: hidden;
  background: #f4f4f2;
  box-shadow: 0 calc(6px + var(--p) * 10px) calc(12px + var(--p) * 14px) rgba(0, 0, 0, calc(.12 + var(--p) * .1));
  /* 당길 때 살짝 늘어나는 고무줄 느낌 */
  transform: scaleY(calc(1 + var(--p) * (1 - var(--p)) * .16));
  transform-origin: bottom;
}

/* 병풍 접힌 면 음영: 칸마다 번갈아 */
.pull-panel:nth-child(odd) .pull-window::after,
.pull-panel:nth-child(even) .pull-window::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.pull-panel:nth-child(odd) .pull-window::after {
  background: linear-gradient(90deg, rgba(0, 0, 0, .1), transparent 22%, transparent 85%, rgba(255, 255, 255, .12));
}

.pull-panel:nth-child(even) .pull-window::after {
  background: linear-gradient(270deg, rgba(0, 0, 0, .12), transparent 22%);
}

.pull-window img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

/* 닫힌 그림은 위로 밀려 올라가며 사라지고, 열린 그림이 아래에서 올라와 자리 잡음 */
.pull-closed {
  opacity: calc(1 - var(--p) * 1.25);
  transform: translateY(calc(var(--p) * -7%));
}

.pull-open {
  opacity: calc(var(--p) * 1.4 - .2);
  transform: translateY(calc((1 - var(--p)) * 7%));
}

/* 열리면 숫자 배지가 톡 튀어나옴 */
.pull-count {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .2);
  transform: scale(0);
  transition: transform .35s cubic-bezier(.34, 1.8, .64, 1);
}

.pull-count b {
  font-size: 22px;
  line-height: 1;
}

.pull-count span {
  font-size: 10px;
  font-weight: 700;
  color: #686868;
}

.pull-panel.is-open .pull-count {
  transform: scale(1);
}

.pull-panel figcaption {
  padding: 10px 4px 0;
  text-align: center;
}

.pull-panel figcaption b {
  display: block;
  font-size: 13px;
  line-height: 1.3;
}

.pull-item {
  display: block;
  min-height: 34px;
  margin-top: 4px;
  font-size: 11px;
  color: #686868;
}

.pull-item em {
  display: block;
  font-style: normal;
  opacity: 0;
  transition: opacity .3s;
}

.pull-panel.is-open .pull-item em {
  opacity: 1;
}

.pull-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 3px;
  margin-top: 4px;
}

.pull-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ffcf4a;
  box-shadow: inset 0 0 0 1.5px #d9a520;
  transform: scale(0);
  transition: transform .25s cubic-bezier(.34, 1.8, .64, 1);
}

.pull-panel.is-open .pull-dots i {
  transform: scale(1);
  transition-delay: calc(.25s + var(--d) * 70ms);
}

/* 시범을 보여 주는 손 */
.pull-hand {
  position: absolute;
  z-index: 10;
  width: 48px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s, top .55s cubic-bezier(.3, .8, .3, 1);
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .25));
}

.pull-hand svg {
  width: 100%;
  height: auto;
  display: block;
  transition: transform .2s;
}

.pull-hand.is-visible {
  opacity: 1;
}

.pull-hand.is-grab svg {
  transform: scale(.88) rotate(-8deg);
}

/* 뒷면: 동물 전신 */
.pull-back-title {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
}

.pull-back-strip {
  display: flex;
  overflow-x: auto;
  border: 1px solid #e3e3e3;
}

.pull-back-cell {
  flex: 1 0 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 260px;
  padding: 10px;
  background: #fff;
  border-right: 1px dashed #dedede;
}

.pull-back-cell:last-child {
  border-right: 0;
}

.pull-back-cell img {
  width: 100%;
  height: auto;
}

@media (max-width: 800px) {
  .pull-book {
    padding: 20px 12px;
  }

  .pull-panel {
    flex-basis: 42%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pull-tab span {
    animation: none;
  }

  .pull-count,
  .pull-dots i,
  .pull-stage {
    transition: none;
  }
}

/* ---------- 두 손으로 늘리는 책: 알 책·도형 책 (Pages/Shared/_EggBook·_ShapeBook.cshtml, js/stretch.js) ---------- */
.stretch-book {
  background: #fff;
  border: 1px solid #dedede;
  padding: 32px 40px 28px;
}

.stretch-stage {
  position: relative;
}

.stretch-item {
  margin: 0;
  cursor: grab;
  touch-action: none;
  user-select: none;
  outline: none;
}

.stretch-item.is-dragging {
  cursor: grabbing;
}

.stretch-item:focus-visible .egg-frame,
.stretch-item:focus-visible .shape-frame {
  outline: 3px solid #222629;
  outline-offset: 3px;
}

/* 알 책 */
.egg-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 26px 18px;
}

.egg-frame {
  --top-y: 29.943%;
  --bottom-y: 46.857%;
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  background: #fff;
}

.egg-under,
.egg-piece {
  position: absolute;
  left: 0;
  width: 100%;
  pointer-events: none;
}

.egg-under {
  top: 0;
  height: 100%;
  clip-path: inset(50% 0 50% 0);
}

.egg-piece.is-top {
  top: var(--top-y);
  height: var(--top-h);
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .12));
}

.egg-piece.is-bottom {
  top: var(--bottom-y);
  height: var(--bottom-h);
  filter: drop-shadow(0 -3px 4px rgba(0, 0, 0, .1));
}

/* 닫혀 있을 때 알이 살짝 흔들림 */
.egg-card:not(.is-revealed) .egg-frame {
  animation: egg-wobble 3.2s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * .3s);
}

.egg-card:nth-child(2n) .egg-frame { --i: 1; }
.egg-card:nth-child(3n) .egg-frame { --i: 2; }

@keyframes egg-wobble {
  0%, 82%, 100% { transform: rotate(0); }
  86% { transform: rotate(-2deg); }
  90% { transform: rotate(2deg); }
  94% { transform: rotate(-1deg); }
}

.egg-card figcaption {
  position: relative;
  height: 26px;
  margin-top: 10px;
  text-align: center;
}

.egg-q,
.egg-name {
  position: absolute;
  inset: 0;
  transition: opacity .25s, transform .35s cubic-bezier(.34, 1.8, .64, 1);
}

.egg-q {
  font-size: 13px;
  color: #8a8a8a;
}

.egg-name {
  font-size: 16px;
  opacity: 0;
  transform: scale(.4);
}

.egg-card.is-revealed .egg-q {
  opacity: 0;
}

.egg-card.is-revealed .egg-name {
  opacity: 1;
  transform: scale(1);
}

/* 도형 책 */
.shape-list {
  display: grid;
  gap: 30px;
  max-width: 1000px;
  margin: 0 auto;
}

.shape-frame {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  background: #f4f4f2;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .1);
  transform-origin: center;
}

.shape-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.shape-card figcaption {
  margin-top: 10px;
  text-align: center;
}

.shape-card figcaption b {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 15px;
  background: #f0f0ee;
  transition: background .3s, color .3s, transform .35s cubic-bezier(.34, 1.8, .64, 1);
}

.shape-card.is-revealed figcaption b {
  background: #222629;
  color: #fff;
  transform: scale(1.12);
}

/* 시범을 보여 주는 두 손 */
.stretch-hand {
  --rot: 0deg;
  position: absolute;
  z-index: 20;
  width: 46px;
  transform: translate(-50%, -50%) rotate(var(--rot));
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .25));
}

.stretch-hand svg {
  display: block;
  width: 100%;
  height: auto;
  transition: transform .2s;
}

.stretch-hand.is-visible {
  opacity: 1;
}

.stretch-hand.is-grab svg {
  transform: scale(.86);
}

.egg-book .stretch-hand.is-a { --rot: 180deg; }
.egg-book .stretch-hand.is-b { --rot: 0deg; }
.shape-book .stretch-hand.is-a { --rot: 90deg; }
.shape-book .stretch-hand.is-b { --rot: -90deg; }

@media (max-width: 1000px) {
  .egg-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 800px) {
  .stretch-book {
    padding: 20px 12px;
  }

  .egg-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .egg-card .egg-frame {
    animation: none !important;
  }

  .egg-q,
  .egg-name,
  .shape-card figcaption b {
    transition: none;
  }
}

/* ---------- 먹이사슬 접이책 (Pages/Shared/_FoldBook.cshtml, js/fold.js) ---------- */
.fold-book {
  background: #fff;
  border: 1px solid #dedede;
  padding: 32px 40px 28px;
}

/* 목록: 배경 그림 */
.fold-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);   /* 한 줄에 두 장씩 크게 */
  gap: 40px 32px;
}

.fold-thumb {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: #202020;
  cursor: zoom-in;
}

.fold-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .12);
  transition: transform .25s, box-shadow .25s;
}

.fold-thumb:hover img,
.fold-thumb:focus-visible img {
  transform: translateY(-6px) scale(1.03);
  box-shadow: 0 14px 28px rgba(0, 0, 0, .18);
}

.fold-thumb:focus-visible {
  outline: none;
}

.fold-thumb:focus-visible img {
  outline: 3px solid #222629;
  outline-offset: 3px;
}

.fold-thumb span {
  font-size: 18px;
  font-weight: 700;
}

/* 크게 보기: 장면(3:2)이 화면 높이를 거의 다 쓰도록. 버튼 막대는 그림 위 왼쪽·오른쪽 빈 곳에 겹쳐 둠 */
.fold-dialog {
  width: min(99vw, calc((100vh - 24px) * 1.5 + 16px));
  max-width: none;
  max-height: 100vh;
  padding: 8px;
  border: 0;
  border-radius: 10px;
  background: #fff;
  overflow: visible;
}

.fold-dialog::backdrop {
  background: rgba(20, 24, 26, .78);
}

.fold-dialog.is-zooming::backdrop {
  animation: fold-backdrop .5s ease-out;
}

@keyframes fold-backdrop {
  from { background: rgba(20, 24, 26, 0); }
}

.fold-dialog-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.fold-dialog-title {
  font-size: 18px;
}

.fold-dialog-buttons {
  display: flex;
  gap: 6px;
}

.fold-dialog-buttons button {
  min-width: 40px;
  height: 38px;
  padding: 0 14px;
  border: 1px solid #d6d9da;
  border-radius: 999px;
  background: #fff;
  color: #222629;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.fold-dialog-buttons .fold-close {
  background: #222629;
  border-color: #222629;
  color: #fff;
}

.fold-dialog .fb-hint {
  display: none;
}

/* 장면 위쪽 양옆(배경 그림 왼쪽·오른쪽)은 비어 있으므로 제목과 버튼을 그 위에 올림 */
.fold-dialog-bar {
  position: absolute;
  top: 14px;
  left: 16px;
  right: 16px;
  z-index: 30;
  margin: 0;
  pointer-events: none;
}

.fold-dialog-bar > * {
  pointer-events: auto;
}

.fold-dialog-title {
  max-width: 30%;
  line-height: 1.3;
}

.fold-dialog-buttons {
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 32%;
}

.fold-card {
  margin: 0;
  cursor: grab;
  touch-action: none;
  user-select: none;
  outline: none;
}

.fold-card.is-dragging {
  cursor: grabbing;
}

.fold-card:focus-visible .fold-scene {
  outline: 3px solid #222629;
  outline-offset: 4px;
}

/* 장면: 6칸 너비 × (배경 1칸 높이 + 띠 1칸 높이) = 3 : 2 */
.fold-scene {
  --flip: 180deg;
  --wing: 180deg;
  --outer: 180deg;
  position: relative;
  aspect-ratio: 3 / 2;
  perspective: 1400px;
  perspective-origin: 50% 40%;
}

.fold-bg {
  position: absolute;
  left: 33.333%;
  top: 0;
  width: 33.334%;
  height: 50%;
  object-fit: cover;
  box-shadow: 0 6px 14px rgba(0, 0, 0, .12);
}

.fold-flip,
.fold-center,
.fold-wing,
.fold-outer {
  position: absolute;
  transform-style: preserve-3d;
}

/* 아래쪽 6칸 띠 전체: 배경 아래 경계를 축으로 위로 접혔다가 내려옴 */
.fold-flip {
  left: 0;
  top: 50%;
  width: 100%;
  height: 50%;
  transform-origin: 50% 0;
  transform: rotateX(var(--flip));
  transition: opacity .35s;
}

/* 확대되는 동안은 배경만 보이고, 다 커지면 접힌 덮개가 나타남 */
.fold-card.is-intro .fold-flip {
  opacity: 0;
  transition: none;
}

.fold-card .fold-scene {
  transition: opacity .2s;
}

.fold-card.is-switching .fold-scene {
  opacity: 0;
}

.fold-center {
  left: 33.333%;
  top: 0;
  width: 33.334%;
  height: 100%;
}

.fold-wing {
  top: 0;
  width: 16.667%;
  height: 100%;
}

.fold-wing.is-left {
  left: 16.667%;
  transform-origin: 100% 50%;
  transform: rotateY(var(--wing));
}

.fold-wing.is-right {
  left: 66.666%;
  transform-origin: 0 50%;
  transform: rotateY(calc(var(--wing) * -1));
}

.fold-outer {
  top: 0;
  width: 100%;
  height: 100%;
}

.fold-wing.is-left .fold-outer {
  left: -100%;
  transform-origin: 100% 50%;
  transform: rotateY(calc(var(--outer) * -1));
}

.fold-wing.is-right .fold-outer {
  left: 100%;
  transform-origin: 0 50%;
  transform: rotateY(var(--outer));
}

.fold-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background-color: #fff;
}

/* 띠 이미지를 칸별로 잘라 보여 줌 */
.fold-face.is-front {
  background-image: var(--strip);
  background-size: 600% 100%;
  background-position: calc(var(--col, 0) * 20%) 0;
  box-shadow: inset 1px 0 0 rgba(0, 0, 0, .06);
}

.fold-center .fold-face.is-front {
  background-size: 300% 100%;
  background-position: 50% 0;
}

.fold-face.is-back {
  transform: rotateY(180deg);
  background: #f6f6f3;
}

/* 접힌 덮개의 겉면 (위로 접혔을 때 보이는 면) */
.fold-face.is-cover {
  transform: rotateX(180deg);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #bfe3d6;
  color: #2f5b4c;
  font-weight: 800;
  font-size: clamp(14px, 1.8vw, 20px);
  letter-spacing: .04em;
}

/* 완전히 접혀 있을 때: 겹쳐 있는 안쪽 면 숨기기 */
.fold-card.is-packed .fold-center .is-front,
.fold-card.is-packed .fold-wing > .is-back,
.fold-card.is-packed .fold-outer > .is-back {
  visibility: hidden;
}

.fold-card figcaption {
  margin-top: 12px;
  text-align: center;
}

.fold-card figcaption b {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 999px;
  background: #f0f0ee;
  font-size: 14px;
  transition: background .3s, color .3s, transform .35s cubic-bezier(.34, 1.8, .64, 1);
}

.fold-card.is-open figcaption b {
  background: #222629;
  color: #fff;
  transform: scale(1.08);
}

@media (max-width: 800px) {
  .fold-book {
    padding: 20px 12px;
  }

  .fold-gallery {
    grid-template-columns: repeat(2, 1fr);
  }

  .fold-gallery {
    grid-template-columns: 1fr;
  }

  .fold-dialog {
    padding: 6px;
  }

  /* 좁은 화면에서는 버튼 막대를 그림 위가 아니라 위쪽에 따로 */
  .fold-dialog-bar {
    position: static;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 6px;
  }

  .fold-dialog-title,
  .fold-dialog-buttons {
    max-width: none;
  }
}

/* ---------- 숨은 그림 찾기 - 직접 누르기 (Pages/Shared/_SpotGame.cshtml, js/spot.js) ---------- */
.spot-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 24px;
  align-items: start;
}

.spot-scene {
  position: relative;
  width: 100%;
  border-radius: 6px;
  overflow: hidden;
  cursor: crosshair;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.spot-scene img {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* 찾은 위치 동그라미 */
.spot-mark {
  position: absolute;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 4px solid #e2433b;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .85), inset 0 0 0 3px rgba(255, 255, 255, .85);
  pointer-events: none;
}

.spot-mark.is-new {
  animation: spot-found .55s cubic-bezier(.34, 1.56, .64, 1);
}

@keyframes spot-found {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.8);
  }
}

/* 빗나간 위치 */
.spot-miss {
  position: absolute;
  width: 28px;
  height: 28px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: spot-miss .7s ease-out forwards;
}

.spot-miss::before,
.spot-miss::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 26px;
  height: 4px;
  border-radius: 2px;
  background: rgba(34, 38, 41, .75);
  transform: translate(-50%, -50%) rotate(45deg);
}

.spot-miss::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

@keyframes spot-miss {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(.6); }
  30% { transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}

.spot-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.spot-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 6px 10px;
  border: 1px solid #e3e3e3;
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  line-height: 1.3;
  transition: border-color .2s, opacity .2s;
}

.spot-item img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.spot-item.is-found {
  border-color: #222629;
  box-shadow: 0 0 0 1px #222629;
}

.spot-item.is-found img {
  opacity: .45;
}

.spot-item.is-found::after {
  content: "";
  position: absolute;
  top: 6px;
  left: 6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #222629 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center / 12px no-repeat;
}

.spot-item.is-pop {
  animation: find-pop .3s ease-out;
}

@media (max-width: 1000px) {
  .spot-layout {
    grid-template-columns: 1fr;
  }

  .spot-list {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (max-width: 600px) {
  .spot-list {
    grid-template-columns: repeat(3, 1fr);
  }

  .spot-item img {
    width: 48px;
    height: 48px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .spot-mark.is-new,
  .spot-miss {
    animation: none;
  }
}

/* ---------- 캐릭터 갤러리 (Pages/Shared/_CharacterGallery.cshtml) ---------- */
.character-gallery {
  margin-top: 24px;
  background: #fff;
  border: 1px solid #dedede;
  padding: 32px 40px 36px;
}

.char-group + .char-group {
  margin-top: 32px;
}

.char-group h4 {
  margin: 0 0 14px;
  font-size: 16px;
}

.char-group h4 small {
  margin-left: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #8a8a8a;
}

.char-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}

.image-open.char-card {
  position: relative;
  aspect-ratio: 4 / 5;
  padding: 14px;
  border-radius: 8px;
  background: radial-gradient(circle at 50% 62%, #eef3ec 0 46%, #f7f7f5 47%);
  transition: transform .25s, box-shadow .25s;
}

.image-open.char-card img {
  transition: transform .35s cubic-bezier(.34, 1.56, .64, 1);
}

.image-open.char-card:hover,
.image-open.char-card:focus-visible {
  box-shadow: 0 10px 24px rgba(0, 0, 0, .08);
}

.image-open.char-card:hover img,
.image-open.char-card:focus-visible img {
  transform: translateY(-6px) rotate(-3deg);
}

.image-open.char-card:focus-visible {
  outline: 2px solid #333;
  outline-offset: 3px;
}

@media (max-width: 1100px) {
  .char-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 800px) {
  .character-gallery {
    padding: 22px 14px 26px;
  }

  .char-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .image-open.char-card img {
    transition: none;
  }
}

/* ---------- 그림책·인지 카드 전환 탭 (Pages/Shared/_IllustrationTabs.cshtml) ---------- */
.sub-tabs {
  display: flex;
  gap: 4px;
  margin: -8px 0 28px;
  border-bottom: 1px solid #dcdcdc;
}

.sub-tabs a {
  padding: 12px 20px;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  color: #686868;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}

.sub-tabs a:hover {
  color: #202020;
}

.sub-tabs a[aria-current="page"] {
  color: #202020;
  border-bottom-color: #222629;
}

/* ---------- 인지 카드 (Pages/Cards.cshtml, js/cards.js) ---------- */
.card-deck {
  background: #fff;
  border: 1px solid #dedede;
  padding: 32px 40px 28px;
}

.deck-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 28px;
}

.deck-head h3 {
  font-size: 26px;
  letter-spacing: -.03em;
  margin: 10px 0 6px;
}

.deck-head span {
  font-size: 13px;
  color: #686868;
}

.deck-tabs {
  display: flex;
  flex-wrap: wrap;
  max-width: 100%;
  padding: 4px;
  border: 1px solid #d6d9da;
  border-radius: 6px;
  gap: 4px;
}

.deck-tabs a {
  padding: 9px 16px;
  border-radius: 4px;
  color: #555;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.deck-tabs a[aria-selected="true"] {
  background: #222629;
  color: #fff;
}

/* 카드 테이블: 카드가 한 장씩 놓이는 등장 애니메이션 */
.card-table {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 22px 18px;
  padding: 8px 4px;
}

.deck-card {
  position: relative;
  aspect-ratio: 109 / 150;
  padding: 0;
  border: 0;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .12), 0 6px 14px rgba(0, 0, 0, .1);
  cursor: pointer;
  animation: deck-deal .45s cubic-bezier(.2, .8, .3, 1.2) backwards; /* 끝난 뒤에는 hover 변형이 적용되도록 */
  animation-delay: calc(min(var(--i), 30) * 25ms);
  transition: transform .25s, box-shadow .25s;
}

.deck-card:nth-child(3n + 1) {
  --tilt: -1.2deg;
}

.deck-card:nth-child(3n + 2) {
  --tilt: .8deg;
}

.deck-card:nth-child(3n) {
  --tilt: -.4deg;
}

.deck-card {
  transform: rotate(var(--tilt, 0deg));
}

.deck-card:hover,
.deck-card:focus-visible {
  transform: translateY(-8px) rotate(0deg) scale(1.03);
  box-shadow: 0 2px 4px rgba(0, 0, 0, .1), 0 16px 30px rgba(0, 0, 0, .16);
  z-index: 1;
}

.deck-card:focus-visible {
  outline: 2px solid #333;
  outline-offset: 3px;
}

@keyframes deck-deal {
  from {
    opacity: 0;
    transform: translateY(24px) rotate(-6deg) scale(.92);
  }
}

.deck-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}

.deck-num {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 2px 7px;
  border-radius: 10px;
  background: rgba(34, 38, 41, .78);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* 카드 크게 보기 */
.card-viewer {
  width: min(92vw, 720px);
  max-height: 96vh;
  padding: 16px 16px 20px;
  border: 0;
  border-radius: 8px;
  background: #f4f4f2;
  overflow: visible;
}

.card-viewer::backdrop {
  background: rgba(0, 0, 0, .72);
}

.cv-close {
  display: block;
  margin: 0 0 12px auto;
  padding: 9px 16px;
  border: 0;
  border-radius: 4px;
  background: #222629;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.cv-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  perspective: 1600px;
}

.cv-stage > button {
  flex: none;
  width: 44px;
  height: 44px;
  border: 1px solid #d6d9da;
  border-radius: 50%;
  background: #fff;
  font-size: 18px;
  cursor: pointer;
}

.cv-stage > button:disabled {
  opacity: .3;
  cursor: default;
}

.cv-card {
  position: relative;
  width: min(100%, calc((86vh - 120px) * 109 / 150));
  aspect-ratio: 109 / 150;
  transform-style: preserve-3d;
  transition: transform .28s ease-in-out;
  cursor: pointer;
  touch-action: pan-y;
}

.card-viewer.is-opening .cv-card {
  transition-duration: .7s;
  transition-timing-function: cubic-bezier(.2, .8, .3, 1);
}

.cv-card.is-back {
  transform: rotateY(180deg);
  transition: none;
}

.cv-card.is-out-left {
  transform: rotateY(-90deg);
}

.cv-card.is-out-right {
  transform: rotateY(90deg);
}

.cv-card.is-in-right {
  transform: rotateY(90deg);
  transition: none;
}

.cv-card.is-in-left {
  transform: rotateY(-90deg);
  transition: none;
}

.cv-face {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .25);
}

.cv-front {
  background: #fff;
}

.cv-front img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* 카드 뒷면 */
.cv-back {
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, .9) 0 34%, transparent 35%),
    repeating-linear-gradient(45deg, #eef3ec 0 10px, #e2eadf 10px 20px);
  border: 10px solid #fff;
  color: #555;
  font-size: 13px;
  text-align: center;
}

.cv-back img {
  width: 30%;
  height: auto;
}

.cv-back .brand-name {
  font-size: 22px;
}

.cv-status {
  margin-top: 14px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 800px) {
  .card-deck {
    padding: 20px 12px;
  }

  .deck-head {
    display: block;
  }

  .deck-tabs {
    margin-top: 16px;
    width: fit-content;
  }

  .card-table {
    grid-template-columns: repeat(3, 1fr);
    gap: 14px 10px;
  }

  .cv-stage > button {
    width: 36px;
    height: 36px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .deck-card {
    animation: none;
  }

  .cv-card {
    transition: none;
  }
}

/* 그림책 목록 */
.book-shelf {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 22px 18px;
}

.shelf-item {
  color: #202020;
  text-decoration: none;
  display: flex;
  flex-direction: column;
}

/* 책 표지: 왜곡 없이 cover 로 채우고, 제본 쪽 음영 + 바닥에 가까운 부드러운 그림자 */
.shelf-cover {
  position: relative;
  display: block;
  aspect-ratio: 790 / 1079;
  background-size: cover;
  background-position: center;
  border-radius: 2px 5px 5px 2px;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, .14),
    0 4px 8px rgba(0, 0, 0, .08),
    0 12px 22px -8px rgba(0, 0, 0, .22);
  transition: transform .3s ease, box-shadow .3s ease;
}

/* 제본선: 왼쪽 가장자리에 얇은 접힘 음영과 밝은 선 */
.shelf-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg,
    rgba(0, 0, 0, .18) 0,
    rgba(0, 0, 0, .06) 2.5%,
    rgba(255, 255, 255, .22) 3.5%,
    rgba(255, 255, 255, 0) 6%,
    rgba(0, 0, 0, 0) 94%,
    rgba(0, 0, 0, .05) 100%);
  pointer-events: none;
}

.shelf-item:hover .shelf-cover {
  transform: translateY(-5px);
  box-shadow:
    0 2px 3px rgba(0, 0, 0, .12),
    0 8px 14px rgba(0, 0, 0, .1),
    0 22px 32px -10px rgba(0, 0, 0, .28);
}

.shelf-item[aria-current="true"] .shelf-cover {
  outline: 3px solid #222629;
  outline-offset: 3px;
}

.shelf-item b {
  font-size: 14px;
  margin-top: 12px;
  line-height: 1.4;
}

.shelf-item small {
  font-size: 12px;
  color: #686868;
  margin-top: 4px;
}

@media (max-width: 1100px) {
  .book-shelf {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 800px) {
  .flipbook {
    padding: 20px 12px;
  }

  .fb-stage {
    padding: 26px 16px 32px;
  }

  .fb-head {
    display: block;
  }

  .fb-head h3 {
    font-size: 21px;
    margin-bottom: 6px;
  }

  .book-shelf {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .fb-book,
  .fb-leaf {
    transition: none;
  }

  .fb-leaf.is-moving .fb-face::before {
    animation: none;
  }
}

/* ---------- 캐릭터·IP 종합 디자인 (Pages/Ip.cshtml, Content/ip.json) ---------- */
.ip-case {
  background: #fff;
  border: 1px solid #dedede;
  padding: 40px;
}

.ip-hero {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 44px;
  align-items: center;
}

.image-open.ip-cover img {
  height: auto;
  aspect-ratio: 1312 / 1199;
  object-fit: cover;
}

.ip-intro h3 {
  font-size: 34px;
  letter-spacing: -.04em;
  margin: 12px 0 10px;
}

.ip-intro p {
  margin: 0 0 16px;
  font-size: 15px;
  line-height: 1.85;
  color: #5b6266;
}

.ip-intro .ip-tagline {
  font-size: 14px;
  color: #202020;
  font-weight: 700;
}

.ip-facts {
  display: grid;
  gap: 0;
  margin: 24px 0;
  border-top: 1px solid #e3e3e3;
}

.ip-facts div {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid #e3e3e3;
  font-size: 13px;
}

.ip-facts dt {
  color: #686868;
  font-weight: 700;
}

.ip-facts dd {
  margin: 0;
}

.ip-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ip-toc a {
  display: inline-flex;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid #d6d9da;
  border-radius: 4px;
  color: #333;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.ip-toc a span {
  color: #8a8a8a;
  font-variant-numeric: tabular-nums;
}

.ip-toc a:hover {
  border-color: #222629;
}

.ip-section {
  margin-top: 72px;
  scroll-margin-top: 24px;
}

.ip-grid {
  display: grid;
  gap: 18px;
  align-items: start;
}

.ip-grid--two {
  grid-template-columns: repeat(2, 1fr);
}

.ip-grid--mixed {
  grid-template-columns: repeat(3, 1fr);
}

.ip-grid--four {
  grid-template-columns: repeat(4, 1fr);
}

.ip-grid figure.is-wide {
  grid-column: 1 / -1;
}

.ip-grid .image-open img {
  height: auto;
}

.ip-grid .image-open {
  transition: opacity .2s;
}

.ip-grid .image-open:hover {
  opacity: .9;
}

@media (max-width: 1100px) {
  .ip-hero {
    grid-template-columns: 1fr;
  }

  .ip-grid--four {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 800px) {
  .ip-case {
    padding: 20px 12px;
  }

  .ip-intro h3 {
    font-size: 26px;
  }

  .ip-section {
    margin-top: 52px;
  }

  .ip-grid--two,
  .ip-grid--mixed {
    grid-template-columns: 1fr;
  }

  .ip-grid--four {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}

/* ---------- 펼침 갤러리의 묶음 제목 (projects.json 의 groups) ---------- */
.gallery-group + .gallery-group {
  margin-top: 56px;
}

.gallery-group h4 {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e3e3e3;
  font-size: 18px;
}

.gallery-group h4 span {
  color: #6e7472;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 1px;
}

@media (max-width: 800px) {
  .gallery-group + .gallery-group {
    margin-top: 40px;
  }
}

/* ---------- 상품 일러스트의 브랜드 로고 띠 (projects.json 의 brand) ---------- */
.brand-strip {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 40px;
  padding: 20px 28px;
  background: #fff;
  border: 1px solid #e1e4e2;
}

.brand-strip img {
  height: 76px;
  width: auto;
}

.brand-strip b {
  font-size: 24px;
}

.brand-strip span {
  color: #6e7472;
  font-size: 14px;
  line-height: 1.7;
}

/* ---------- 갤러리 모양 변형 (projects.json 의 layout) ---------- */
.sticker-gallery.gallery--photo {
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.sticker-gallery.gallery--photo img {
  height: auto;
  aspect-ratio: 1;
  padding: 0;
  object-fit: cover;
}

.sticker-gallery.gallery--masonry {
  display: block;
  columns: 3;
  column-gap: 24px;
}

.sticker-gallery.gallery--masonry figure {
  break-inside: avoid;
  margin-bottom: 24px;
}

.sticker-gallery.gallery--masonry img {
  height: auto;
  padding: 0;
}

.sticker-gallery.gallery--icon {
  grid-template-columns: repeat(8, 1fr);
  gap: 16px;
}

.sticker-gallery.gallery--icon img {
  height: auto;
  aspect-ratio: 1;
  padding: 12px;
}

.sticker-gallery.gallery--icon figcaption {
  padding: 9px 8px;
  text-align: center;
}

@media (max-width: 800px) {
  .sticker-gallery.gallery--icon {
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
  }

  .brand-strip {
    gap: 16px;
    margin-bottom: 28px;
    padding: 16px;
  }

  .brand-strip img {
    height: 56px;
  }

  .sticker-gallery.gallery--photo {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .sticker-gallery.gallery--masonry {
    columns: 2;
    column-gap: 10px;
  }

  .sticker-gallery.gallery--masonry figure {
    margin-bottom: 10px;
  }
}

/* ---------- 분류 내부 페이지 공통 (v52): 3분류 메뉴, 제목 줄, 돌아가기, 필터 칩 ----------
   /ip · /books · /products 와 그 상세 페이지. 흰 바탕에 제목 30px(모바일 25px), 설명 13px. */
.inner-page {
  padding-top: 0;
}

.inner-page [hidden] {
  display: none !important;
}

.collection-nav {
  display: flex;
  gap: 26px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}

.collection-nav::-webkit-scrollbar {
  display: none;
}

.collection-nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 0 13px;
  color: #767676;
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
}

.collection-nav a:hover {
  color: var(--ink);
}

.collection-nav small {
  color: #999;
  font: 10px Arial, sans-serif;
}

/* 현재 분류: 짙은 글자 + 글자 폭만큼의 짧은 밑줄 */
.collection-nav a[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--ink);
}

.page-head {
  padding: 26px 0 20px;
}

.page-head small {
  color: #707070;
  font: 10px Arial, sans-serif;
  letter-spacing: 1.2px;
}

.page-head h1 {
  margin: 8px 0;
  font-size: 30px;
  font-weight: 650;
  line-height: 1.4;
  letter-spacing: -.04em;
}

.page-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.page-head--count {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
}

.page-head--count > b {
  color: #767676;
  font: 400 11px Arial, sans-serif;
  letter-spacing: 1px;
  white-space: nowrap;
}

.back-link {
  display: inline-block;
  margin: 18px 0 16px;
  color: #555;
  font-size: 13px;
  text-decoration: none;
}

.back-link:hover {
  color: var(--ink);
  text-decoration: underline;
}

.page-head .back-link {
  margin: 0 0 6px;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
  padding: 12px 0;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
}

.filter-chips button {
  padding: 7px 13px;
  border: 1px solid #e0e0e0;
  border-radius: 3px;
  background: #fff;
  color: #666;
  font: inherit;
  font-size: 12px;
  line-height: 1.5;
  cursor: pointer;
}

.filter-chips button:hover {
  border-color: #999;
}

.filter-chips button[aria-pressed="true"] {
  background: #333;
  border-color: #333;
  color: #fff;
}

.filter-chips button:focus-visible,
.collection-nav a:focus-visible,
.product-tabs a:focus-visible,
.back-link:focus-visible {
  outline: 2px solid #333;
  outline-offset: 2px;
}

.filter-empty,
.asset-note {
  margin: 0;
  padding: 26px 0;
  color: var(--muted);
  font-size: 13px;
}

.inner-page .projects-group {
  margin-top: 0;
  padding: 8px 0 44px;
}

/* ---------- /ip: 프로젝트 카드 (4:3 미리보기 한 장) ---------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.project-card {
  display: block;
  color: inherit;
  text-decoration: none;
}

.project-media {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #f3f3f3;
}

.project-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s;
}

.project-card:hover .project-media img {
  transform: scale(1.02);
}

.project-card:focus-visible {
  outline: 2px solid #333;
  outline-offset: 4px;
}

.project-meta {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.project-meta small {
  color: #707070;
  font: 10px Arial, sans-serif;
  letter-spacing: .7px;
}

.project-meta h3 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 6px 0 0;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
}

.project-meta h3 span:last-child {
  color: #777;
  font: 18px Arial, sans-serif;
}

/* ---------- /books: 흰 서가. 책은 선반 위에 표지만 세워 두고, 정보는 올렸을 때 표시 ---------- */
.bookcase {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 26px 0;
  padding-bottom: 12px;
}

.shelf-book {
  position: relative;
  display: block;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

/* 아래 20px 은 나무 선반(칸마다 이어져 한 줄로 보임) */
.book-volume {
  display: flex;
  justify-content: center;
  align-items: end;
  height: 236px;
  padding: 14px 18px 19px;
  background: linear-gradient(to top, transparent 0 4px, #0000000a 4px 9px, #b79667 9px 12px, #dbba8b 12px 17px, #ecd4af 17px 20px, transparent 20px);
}

.book-volume img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  box-shadow: 1px 2px 3px #0000001f, 4px 6px 12px #00000014;
  transition: translate .2s;
}

.card-volume img {
  border-radius: 8px;
}

.shelf-book:hover .book-volume img,
.shelf-book:focus-visible .book-volume img {
  translate: 0 -5px;
}

.shelf-book:focus-visible {
  outline: 2px solid #666;
  outline-offset: -2px;
}

.shelf-info {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 26px;
  z-index: 2;
  padding: 10px 12px;
  background: #fffffff2;
  box-shadow: 0 3px 16px #0002;
  opacity: 0;
  translate: 0 5px;
  transition: opacity .18s, translate .18s;
  pointer-events: none;
}

.shelf-info strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}

.shelf-info small {
  color: #666;
  font-size: 10px;
}

.shelf-book:hover .shelf-info,
.shelf-book:focus-visible .shelf-info {
  opacity: 1;
  translate: 0 0;
}

/* 터치 화면: 올려 볼 수 없으므로 선반 아래에 제목을 항상 표시 */
@media (hover: none) {
  .shelf-info {
    position: static;
    padding: 6px 8px 0;
    background: none;
    box-shadow: none;
    opacity: 1;
    translate: none;
    text-align: center;
  }

  .shelf-info strong {
    font-size: 11px;
  }
}

/* 그림책 상세: 서가로 돌아가기 아래에 원래의 읽기 화면 */
.reader > :first-child {
  margin-top: 0;
}

/* ---------- /products: 두 입구 탭, 테마 아이콘 (8열 → 6열 → 4열) ---------- */
.product-tabs {
  display: flex;
  gap: 22px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
}

.product-tabs a {
  position: relative;
  padding: 13px 0 14px;
  color: #767676;
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
}

.product-tabs a:hover {
  color: var(--ink);
}

.product-tabs a[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
}

/* 현재 탭의 밑줄: 글자와 아래 선 어느 쪽에도 붙지 않게 띄움 */
.product-tabs a[aria-current="page"]::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 7px;
  left: 0;
  height: 2px;
  background: var(--ink);
}

.product-tabs + .filter-chips {
  border-top: 0;
}

.category-field {
  padding: 22px 24px;
  background: #fafafa;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 22px 16px;
}

.category-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: #555;
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
}

.icon-frame {
  flex: none;
  width: 90px;
  height: 90px;
}

.icon-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform .15s;
}

.category-icon:hover img,
.category-icon:focus-visible img {
  transform: translateY(-3px);
}

.category-icon:hover {
  color: var(--ink);
}

.category-icon:focus-visible {
  outline: 2px solid #666;
  outline-offset: 4px;
}

/* ---------- /products/<테마>: 캐릭터 스티커(같은 높이의 칸에 비율 그대로), 상품 적용 ---------- */
.theme-title {
  display: flex;
  align-items: center;
  gap: 14px;
}

.theme-title img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.theme-title h1 {
  margin: 0;
}

.theme-block {
  padding: 22px 0 26px;
  border-top: 1px solid var(--line);
}

.theme-block .section-head {
  align-items: center;
  margin-bottom: 16px;
}

.theme-block .section-head h2 {
  font-size: 22px;
}

.theme-block .fb-hint {
  margin-bottom: 0;
}

.character-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px 18px;
}

.flip-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 0 8px;
  border: 0;
  background: none;
  color: #707070;
  font: inherit;
  font-size: 10px;
  cursor: pointer;
  perspective: 800px;
  appearance: none;
}

.flip-card img {
  display: block;
  width: 100%;
  height: 165px;
  object-fit: contain;
  filter: url(#sticker-die-cut) drop-shadow(0 1px 1px #00000022);
}

.flip-card:hover img {
  filter: url(#sticker-die-cut) drop-shadow(0 2px 3px #0000002e);
}

.flip-card:focus-visible {
  outline: 2px solid #777;
  outline-offset: 2px;
  border-radius: 8px;
}

.flip-card.is-flipping img {
  animation: sticker-one-flip .6s ease-in-out;
}

@keyframes sticker-one-flip {
  from {
    transform: rotateY(0deg);
  }

  to {
    transform: rotateY(360deg);
  }
}

/* 시계·팔찌: 세로로 길게, 문자판이 보이도록 크게 */
.character-grid--watch {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.character-grid--watch .flip-card img {
  height: 290px;
}

.character-grid--simple .flip-card img {
  width: 90%;
  height: 185px;
}

.sticker-filter {
  position: absolute;
  overflow: hidden;
}

.application-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.application-grid figure {
  border: 0;
}

.application-grid .image-open img {
  height: auto;
  aspect-ratio: 4 / 3;
  background: #f3f3f3;
  object-fit: cover;
}

/* 도안 시트는 잘리지 않게 전체를 보여 줌 */
.application-grid figure[data-kind="sheet"] .image-open img {
  padding: 10px;
  background: #fff;
  border: 1px solid #eee;
  object-fit: contain;
}

.application-grid figcaption {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 11px 0 0;
  border: 0;
}

.application-grid figcaption small {
  color: #707070;
  font-size: 10px;
  letter-spacing: .5px;
}

.application-grid figcaption b {
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}

@media (max-width: 1100px) {
  .bookcase {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .category-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (max-width: 800px) {
  .collection-nav {
    gap: 18px;
  }

  .collection-nav a {
    padding: 12px 0 11px;
    font-size: 12px;
  }

  .page-head {
    padding: 20px 0 16px;
  }

  .page-head h1 {
    font-size: 25px;
  }

  .page-head--count {
    align-items: start;
  }

  .page-head--count > b {
    padding-top: 2px;
    font-size: 9px;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .bookcase {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px 0;
  }

  .book-volume {
    height: 196px;
    padding: 10px 10px 19px;
  }

  .category-field {
    padding: 20px 12px;
  }

  .category-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px 10px;
  }

  .category-icon {
    font-size: 10px;
  }

  .icon-frame {
    width: 68px;
    height: 68px;
  }

  .theme-title img {
    width: 44px;
    height: 44px;
  }

  .character-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px 10px;
  }

  .flip-card img {
    height: 120px;
  }

  .character-grid--watch {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .character-grid--watch .flip-card img {
    height: 220px;
  }

  .character-grid--simple .flip-card img {
    height: 120px;
  }

  .application-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .application-grid figcaption b {
    font-size: 12px;
  }
}

@media (max-width: 520px) {
  .bookcase {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .character-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .character-grid--watch {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .project-media img,
  .book-volume img,
  .shelf-info,
  .icon-frame img {
    transition: none;
  }

  .flip-card.is-flipping img {
    animation: none;
  }
}

/* ---------- /products/applications: 상품 유형 구역, 프로젝트 카드(4:3 표지 한 장), 상세 대화상자 ----------
   Pages/ProductApplications.cshtml, js/applications.js. 카드는 3열 → 2열 → 1열의 같은 높이 격자입니다. */
.section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
  padding: 12px 24px;
  border-bottom: 1px solid #eee;
}

.section-nav a {
  padding: 3px 0;
  color: #555;
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
}

.section-nav a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 5px;
}

.section-nav small {
  margin-left: 5px;
  color: #999;
  font: 10px Arial, sans-serif;
}

.app-section {
  padding-top: 32px;
  scroll-margin-top: 8px;
}

.app-section + .app-section {
  margin-top: 36px;
  border-top: 1px solid var(--line);
}

.app-section .section-head {
  align-items: center;
  margin-bottom: 18px;
}

.app-section .section-head h2 {
  font-size: 22px;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.app-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0;
  border: 1px solid var(--line);
  background: #fff;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  scroll-margin-top: 16px;
}

.app-card .project-media {
  display: block;
  border-bottom: 1px solid #eee;
}

.app-card:hover .project-media img {
  transform: scale(1.02);
}

.app-card:hover {
  border-color: #999;
}

.app-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 13px 16px 14px;
}

.app-card-meta b {
  overflow: hidden;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-card-meta small {
  flex: none;
  color: #707070;
  font-size: 11px;
}

.app-more {
  display: block;
  margin: 22px auto 0;
  padding: 10px 22px;
  border: 1px solid #bbb;
  background: #fff;
  color: #333;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.app-more:hover {
  border-color: #333;
}

.app-card:focus-visible,
.app-more:focus-visible,
.section-nav a:focus-visible,
.app-dialog button:focus-visible {
  outline: 2px solid #333;
  outline-offset: 2px;
}

.app-dialog {
  width: min(1120px, calc(100vw - 48px));
  max-width: none;
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 0;
  background: #fff;
  color: var(--ink);
  overflow: hidden;
}

.app-dialog[open] {
  display: flex;
  flex-direction: column;
}

.app-dialog::backdrop {
  background: #000b;
}

.app-dialog [hidden] {
  display: none !important;
}

.app-dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
}

.app-dialog-head small {
  color: #707070;
  font-size: 11px;
}

.app-dialog-head h2 {
  margin: 2px 0 0;
  font-size: 19px;
  font-weight: 650;
  line-height: 1.4;
  letter-spacing: -.02em;
}

.app-close {
  flex: none;
  padding: 9px 16px;
  border: 0;
  background: #222;
  color: #fff;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.app-dialog-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  min-height: 0;
  overflow: auto;
}

/* 상세 이미지는 원본 비율 그대로 전체를 보여 줌 */
.app-stage {
  position: relative;
  height: min(72vh, 720px);
  background: #f5f5f5;
}

.app-zoom {
  height: 100%;
  padding: 16px;
  background: none;
}

.app-arrow {
  position: absolute;
  top: 50%;
  z-index: 1;
  width: 40px;
  height: 40px;
  padding: 0 0 3px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: #222;
  font: 22px/1 Arial, sans-serif;
  cursor: pointer;
  translate: 0 -50%;
}

.app-arrow--prev {
  left: 12px;
}

.app-arrow--next {
  right: 12px;
}

.app-arrow:hover {
  border-color: #333;
}

.app-info {
  padding: 20px 24px 24px;
  border-left: 1px solid var(--line);
  overflow-wrap: anywhere;
}

/* 중국어는 띄어쓰기가 없어 keep-all 이면 줄이 넘치므로 보통 줄바꿈으로 */
:lang(zh) .app-info {
  word-break: normal;
}

.app-caption {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin: 0;
  font-size: 14px;
}

.app-caption b {
  font-weight: 600;
}

.app-caption span {
  flex: none;
  color: #707070;
  font: 11px Arial, sans-serif;
  letter-spacing: .5px;
}

.app-concept {
  margin: 4px 0 0;
  color: #707070;
  font-size: 11px;
}

.app-thumbs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.app-thumbs button {
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  opacity: .6;
}

.app-thumbs button:hover,
.app-thumbs button[aria-current="true"] {
  border-color: #222;
  opacity: 1;
}

.app-thumbs img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-summary {
  margin: 18px 0 0;
  padding-top: 16px;
  border-top: 1px solid #eee;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.app-related {
  margin-top: 18px;
}

.app-related small {
  color: #707070;
  font-size: 11px;
}

.app-info .project-links {
  margin-top: 10px;
}

.app-info > .project-links {
  margin-top: 20px;
}

@media (max-width: 1000px) {
  .app-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }

  .app-dialog-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-stage {
    height: min(58vh, 620px);
  }

  .app-info {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .app-thumbs {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (max-width: 800px) {
  .product-tabs,
  .section-nav {
    padding-right: 16px;
    padding-left: 16px;
  }

  .app-section {
    padding-top: 26px;
  }

  .app-section + .app-section {
    margin-top: 32px;
  }

  .app-section .section-head h2 {
    font-size: 20px;
  }

  /* 휴대폰: 상세를 화면 전체로 */
  .app-dialog {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    margin: 0;
  }

  .app-dialog-head {
    padding: 12px 16px;
  }

  .app-dialog-head h2 {
    font-size: 17px;
  }

  .app-stage {
    height: 54vh;
  }

  .app-zoom {
    padding: 8px;
  }

  .app-info {
    padding: 16px 16px 24px;
  }

  .app-thumbs {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .app-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-card .project-media img {
    transition: none;
  }
}
