/* CHOPSSAL 홈. 색과 글꼴은 docs/brand-guidelines.md 7, 8장을 따른다. */
@font-face {
  font-family: 'Struggle';
  src: url('assets/fonts/struggle-regular.woff2') format('woff2'),
       url('assets/fonts/struggle-regular.woff') format('woff');
  font-display: swap;
}

:root {
  --cream: #FEFAF3;
  --lavender: #B7A9EE;
  --lavender-tint: #ECE7FB;
  --lavender-deep: #5A48A6;
  --choco: #3D2B26;
  --butter: #FAEDBE;
  --line: rgba(61, 43, 38, .16);
  --face: var(--cream);

  --font-logo: 'Struggle', 'Bagel Fat One', sans-serif;
  --font-display: 'Bagel Fat One', 'Apple SD Gothic Neo', sans-serif;
  --font-body: 'IBM Plex Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;

  --gutter: clamp(20px, 5vw, 48px);
  --radius: 28px;
}

@view-transition { navigation: auto; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--choco);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.75;
  word-break: keep-all;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ul, figure, blockquote { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--lavender-deep); outline-offset: 3px; border-radius: 6px; }

.wrap { max-width: 1160px; margin-inline: auto; padding-inline: var(--gutter); }
.display { font-family: var(--font-display); font-weight: 400; line-height: 1.2; text-wrap: balance; }
.wordmark { font-family: var(--font-logo); font-size: 28px; line-height: 1; color: var(--choco); text-decoration: none; }
.wordmark--sm { font-size: 1.05em; }

/* 메뉴: 왼쪽 위에 떠 있는 작은 상자 */
.menu {
  position: fixed; z-index: 20; top: 16px; left: 16px;
  background: var(--cream); border-radius: 18px; box-shadow: 0 0 0 1px var(--line);
  padding: 14px 18px 12px; display: flex; flex-direction: column; gap: 10px;
}
.menu .wordmark { font-size: 24px; }
.menu__links { display: flex; gap: 18px; font-size: 14.5px; font-weight: 500; line-height: 1.4; }
.menu__links a { text-decoration: none; padding: 2px 0; }
.menu__links a:hover, .menu__links a[aria-current="page"] { box-shadow: 0 1.5px 0 var(--choco); }
.menu__links i { font-style: normal; font-weight: 400; opacity: .55; font-variant-numeric: tabular-nums; margin-left: 2px; }
.menu__cart { margin-left: 14px; }
body:not(.home) main { padding-top: 124px; }

/* 버튼: 알약 모양, 초콜릿 테두리, 아래 짧은 그림자 */
.btn {
  display: inline-block;
  font-weight: 600; font-size: 16px; line-height: 1.3; text-decoration: none; text-align: center;
  padding: 13px 26px; border-radius: 999px;
  border: 1.5px solid var(--choco); background: var(--lavender); color: var(--choco);
  box-shadow: 0 4px 0 var(--choco);
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover { transform: translateY(2px); box-shadow: 0 2px 0 var(--choco); }
.btn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--choco); }
.btn--plain { background: var(--cream); }

.tag {
  display: inline-block; align-self: flex-start;
  font-size: 13px; font-weight: 600; line-height: 1.4;
  padding: 4px 14px; border-radius: 999px;
  background: var(--lavender); color: var(--choco);
}
.tag--quiet { background: transparent; border: 1.5px solid var(--line); font-weight: 500; white-space: nowrap; }

/* 첫 화면: 제품 사진이 가로로 한 줄. 누르면 그 사진이 커지고 정보가 나와요 */
.stage { min-height: 100vh; min-height: 100svh; display: grid; grid-template-rows: 1fr auto; gap: clamp(16px, 3vh, 32px); padding: 116px var(--gutter) 20px; }
.row { display: flex; align-items: center; justify-content: center; gap: clamp(6px, 1vw, 14px); min-height: min(64vh, 660px); }
.tile {
  flex: 1 1 0; min-width: 0; max-width: 132px; height: min(30vh, 280px);
  padding: 0; border: 0; border-radius: 14px; overflow: hidden; cursor: pointer; background: var(--lavender-tint);
  transition: flex-grow .65s cubic-bezier(.3, .8, .2, 1), max-width .65s cubic-bezier(.3, .8, .2, 1), height .65s cubic-bezier(.3, .8, .2, 1), opacity .4s ease, transform .3s ease;
}
.tile img { width: 100%; height: 100%; object-fit: cover; }
.tile:hover { transform: translateY(-8px); }
.row.has-active .tile { max-width: 84px; height: min(20vh, 190px); opacity: .5; }
.row.has-active .tile:hover { opacity: .85; }
.row.has-active .tile[aria-pressed="true"] { flex-grow: 8; max-width: min(50vh, 520px); height: min(64vh, 660px); opacity: 1; transform: none; cursor: default; border-radius: 22px; }

/* 오려 낸 사진(흰 배경 제품 사진): 바탕 없이 제품만 떠 있게 */
.cut { mix-blend-mode: multiply; filter: brightness(1.07) contrast(1.05); }
/* 둥근 틀 안에서는 틀째로 바탕과 섞어야 흰 배경이 사라져요 */
.card__img:has(.cut), .pd__img:has(.cut), .rowi__img:has(.cut), .strip a:has(.cut) { background: none; mix-blend-mode: multiply; }
.card__img .cut, .pd__img .cut, .strip .cut { object-fit: contain; }
.row--few { gap: clamp(20px, 6vw, 96px); }
.row--few .tile { max-width: 200px; }
.tile--cut { position: relative; background: none; border-radius: 0; overflow: visible; max-width: 240px; touch-action: pan-y; }
.row--few .tile--cut { max-width: 280px; }
.tile--cut .frame {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
  mix-blend-mode: multiply; filter: brightness(1.07) contrast(1.05);
  opacity: 0; transition: opacity .22s ease; pointer-events: none; -webkit-user-drag: none; user-select: none;
}
.tile--cut .frame[data-on] { opacity: 1; }
.row.has-active .tile--cut { max-width: 150px; }
.row.has-active .tile--cut[aria-pressed="true"] { max-width: min(72vh, 680px); border-radius: 0; cursor: grab; }
.row.has-active .tile--cut[aria-pressed="true"]:active { cursor: grabbing; }
.info__turn { font-size: 14px; opacity: .7; margin-top: -6px; }

.stage__foot { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 16px 40px; min-height: 148px; }
.stage__foot > * { min-width: 0; }
.stage__foot small { display: block; font-size: 14.5px; font-weight: 500; margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.stage__foot h1, .stage__foot h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(34px, 5.2vw, 76px); line-height: 1.12; }
.stage__hint { font-size: 14.5px; text-align: right; font-variant-numeric: tabular-nums; }
.stage__hint b { font-weight: 600; }
.stage__hint a { font-weight: 600; text-underline-offset: 5px; }
.info { max-width: 26em; display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.info__price { font-size: 20px; font-weight: 600; }
.info__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.info__actions a { font-weight: 600; font-size: 15px; text-underline-offset: 5px; }
.close { font: inherit; font-size: 14.5px; font-weight: 500; background: none; border: 0; padding: 4px 0; color: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 5px; }
.stage__bar { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); padding-top: 14px; font-size: 14.5px; font-weight: 500; }
.stage__bar a { text-underline-offset: 5px; }
.stage__bar i { font-style: normal; font-weight: 400; opacity: .55; margin-left: 4px; }

/* 스크롤하면 떠오르는 것 */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s ease, transform .8s cubic-bezier(.2, .8, .2, 1); }
.js .reveal.in { opacity: 1; transform: none; }

/* 구역 공통 */
.sec { padding-block: clamp(48px, 7vw, 104px); }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 12px 32px; margin-bottom: clamp(24px, 3.4vw, 44px); }
.sec-head h1, .sec-head h2 { font-size: clamp(32px, 4.4vw, 54px); }
.sec-head p { max-width: 30em; }

/* 제품 카드 */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(28px, 3vw, 40px) 20px; }
.card { min-width: 0; text-decoration: none; display: flex; flex-direction: column; gap: 4px; }
.card__img { position: relative; display: block; border-radius: 22px; overflow: hidden; margin-bottom: 10px; background: var(--lavender-tint); transition: transform .14s ease; }
.card__img img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; }
.card:hover .card__img { transform: translateY(-4px); }
.card__tag { position: absolute; left: 12px; top: 12px; }
.card__name { font-weight: 600; font-size: 16.5px; line-height: 1.45; }
.card__price { font-size: 15.5px; }

/* 제품 목록 */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: clamp(24px, 3vw, 40px); }
.chip {
  font: inherit; font-size: 15px; font-weight: 500; line-height: 1.4; cursor: pointer; text-decoration: none;
  padding: 7px 18px; border-radius: 999px; border: 1.5px solid var(--choco); background: var(--cream); color: var(--choco);
}
.chip:hover { background: var(--lavender-tint); }
.chip[aria-pressed="true"] { background: var(--choco); color: var(--cream); }
.empty { padding: 56px 0; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.empty svg { width: 104px; height: auto; aspect-ratio: 553 / 490; }

/* 제품 상세 */
.pd { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1fr); gap: clamp(28px, 6vw, 96px); align-items: start; padding-bottom: clamp(48px, 7vw, 96px); }
.pd__img { border-radius: 22px; overflow: hidden; position: sticky; top: 24px; background: var(--lavender-tint); }
.pd__img img { display: block; width: 100%; height: auto; aspect-ratio: 15 / 19; object-fit: cover; max-height: calc(100vh - 48px); }
.pd__info { display: flex; flex-direction: column; gap: 22px; padding-top: clamp(0px, 6vh, 72px); }
.pd__no { font-size: 14.5px; font-weight: 500; font-variant-numeric: tabular-nums; margin-bottom: -10px; }
.pd__no a { text-underline-offset: 4px; }
.pd__info h1 { font-size: clamp(38px, 5.2vw, 76px); line-height: 1.12; }
.pd__price { font-size: 22px; font-weight: 600; }
.more-info { border-top: 1.5px solid var(--choco); }
.more-info details { border-bottom: 1px solid var(--line); }
.more-info summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; padding: 14px 0; font-weight: 600; font-size: 15.5px; }
.more-info summary::-webkit-details-marker { display: none; }
.more-info summary::after { content: "+"; font-weight: 400; font-size: 20px; line-height: 1; transition: transform .2s ease; }
.more-info details[open] summary::after { transform: rotate(45deg); }
.more-info p { padding: 0 0 16px; font-size: 15.5px; }

/* 다른 제품: 홈의 사진 한 줄을 작게 */
.strip { display: flex; justify-content: center; gap: clamp(6px, 1vw, 12px); padding: 0 var(--gutter) clamp(56px, 8vw, 104px); }
.strip a { flex: 1 1 0; min-width: 0; max-width: 96px; border-radius: 12px; overflow: hidden; opacity: .5; transition: opacity .25s ease, transform .25s ease; }
.strip img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; }
.strip a:hover { opacity: 1; transform: translateY(-6px); }
.strip a[aria-current="page"] { opacity: 1; box-shadow: 0 0 0 2px var(--cream), 0 0 0 3.5px var(--choco); }

.field { display: flex; flex-direction: column; gap: 10px; }
.field > span { font-size: 14px; font-weight: 500; }
.qty { display: inline-flex; align-items: center; align-self: flex-start; border: 1.5px solid var(--choco); border-radius: 999px; overflow: hidden; }
.qty button { font: inherit; font-size: 20px; line-height: 1; width: 44px; height: 44px; border: 0; background: transparent; color: inherit; cursor: pointer; }
.qty button:hover { background: var(--lavender-tint); }
.qty output { min-width: 34px; text-align: center; font-weight: 600; }
.pd__actions { display: flex; flex-wrap: wrap; gap: 14px; padding-bottom: 6px; }
.pd__actions .btn { flex: 1 1 180px; }
.btn[disabled] { background: transparent; box-shadow: none; opacity: .55; cursor: default; transform: none; }
button.btn { font-family: inherit; cursor: pointer; }
.said { font-size: 15px; font-weight: 500; min-height: 1.75em; }
.said a { text-underline-offset: 4px; }
.note { background: var(--lavender-tint); border-radius: 22px; padding: 22px 24px; font-size: 15.5px; }

/* 장바구니 */
.cartpage { display: grid; grid-template-columns: 1.5fr 1fr; gap: clamp(24px, 4vw, 56px); align-items: start; }
.cartpage > * { min-width: 0; }
.rows { border-top: 1px solid var(--line); }
.rowi { display: grid; grid-template-columns: 96px 1fr auto; gap: 8px 18px; align-items: center; padding: 18px 0; border-bottom: 1px solid var(--line); }
.rowi__img { border-radius: 16px; overflow: hidden; grid-row: span 2; }
.rowi__img img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }
.rowi__name { font-weight: 600; line-height: 1.45; text-decoration: none; }
.rowi__name i { font-style: normal; font-weight: 400; opacity: .75; display: block; font-size: 14.5px; }
.rowi__price { font-weight: 600; text-align: right; }
.rowi .qty { justify-self: start; }
.rowi .qty button { width: 38px; height: 38px; }
.del { font: inherit; font-size: 14px; background: none; border: 0; padding: 4px 0; color: inherit; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; justify-self: end; }
.sum { background: var(--lavender-tint); border-radius: var(--radius); padding: clamp(22px, 2.6vw, 32px); display: flex; flex-direction: column; gap: 14px; position: sticky; top: 24px; }
.sum h2 { font-size: 20px; font-weight: 600; }
.sum dl { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.sum dl div { display: flex; justify-content: space-between; gap: 16px; }
.sum dd { margin: 0; text-align: right; }
.sum .total { border-top: 1.5px solid var(--choco); padding-top: 14px; font-weight: 600; font-size: 19px; }
.sum .btn { width: 100%; }

/* 기준 문장과 이야기 */
.tint { background: var(--lavender-tint); border-radius: clamp(28px, 4vw, 56px); margin-inline: clamp(8px, 1.4vw, 20px); }
.say { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(24px, 4vh, 48px); text-align: center; padding-block: 96px; }
.say blockquote { font-size: clamp(44px, 9.4vw, 148px); line-height: 1.08; }
.say p { font-size: clamp(16px, 1.5vw, 19px); max-width: 26em; }
.story { display: grid; grid-template-columns: .8fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: center; padding-block: 0 clamp(72px, 10vw, 140px); }
.story > * { min-width: 0; }
.story img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 38%; border-radius: var(--radius); }
.story__text { max-width: 31em; display: flex; flex-direction: column; gap: 20px; font-size: clamp(17px, 1.5vw, 19px); }
.story__first { font-weight: 600; font-size: 1.25em; line-height: 1.5; }
.story__sign { margin-top: 8px; font-weight: 600; }

/* 소식 */
.news { padding-block: clamp(80px, 12vw, 168px); display: flex; flex-direction: column; align-items: center; gap: 28px; text-align: center; }
.news h2 { font-size: clamp(26px, 3.4vw, 44px); font-weight: 600; line-height: 1.3; text-wrap: balance; }
.news__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }

/* 바닥 */
.foot { border-top: 1px solid var(--line); }
.foot__in { padding-block: 40px 56px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 24px 48px; font-size: 15px; }
.foot__in p { margin-top: 10px; }
.foot ul { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; }
.foot ul a { text-underline-offset: 4px; }

.foot__note { flex-basis: 100%; font-size: 13.5px; opacity: .6; margin: 0 !important; }

@media (max-width: 820px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 28px 14px; }
  .pd, .cartpage, .story { grid-template-columns: 1fr; }
  .pd__info { padding-top: 0; }
  .strip { justify-content: flex-start; overflow-x: auto; scrollbar-width: none; }
  .strip a { flex: 0 0 64px; }
  .pd__img, .sum { position: static; }
  .story img { max-width: 420px; }
  .row { justify-content: flex-start; overflow-x: auto; scroll-snap-type: x proximity; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); min-height: min(56vh, 520px); scrollbar-width: none; }
  .tile { flex: 0 0 30vw; max-width: none; height: min(36vh, 320px); scroll-snap-align: center; }
  .tile:hover { transform: none; }
  .row.has-active .tile { flex-basis: 18vw; max-width: none; }
  .row.has-active .tile[aria-pressed="true"] { flex: 0 0 76vw; max-width: none; height: min(56vh, 520px); }
  .row--few { justify-content: center; gap: 12px; }
  .row--few .tile { flex: 0 0 40vw; }
  .tile--cut, .row--few .tile--cut, .row.has-active .tile--cut { max-width: none; }
  .row.has-active .tile--cut[aria-pressed="true"] { max-width: none; flex: 0 0 84vw; }
  .stage__foot { grid-template-columns: 1fr; min-height: 0; }
  .stage__hint { text-align: left; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .menu { top: 10px; left: 10px; padding: 12px 14px 10px; }
  .menu .wordmark { font-size: 21px; }
  .menu__links { gap: 14px; font-size: 14px; }
  .btn { padding: 12px 22px; font-size: 15.5px; }
  .rowi { grid-template-columns: 76px 1fr; align-items: start; }
  .rowi__img { grid-row: span 4; }
  .rowi .qty { justify-self: start; }
  .rowi__price { text-align: left; }
  .del { justify-self: start; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .card__img, .tile, .tile--cut .frame, .strip a { transition: none; }
  @view-transition { navigation: none; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
}

/* 제품 이름으로 초점을 옮길 때 테두리는 보이지 않게 */
#picked-name:focus { outline: none; }
