:root {
  --sky-top: #060d26;
  --sky-mid: #10245a;
  --sky-low: #2a4a8f;
  --ground: #0b1530;
  --panel: #111f4a;
  --panel-line: rgba(240, 207, 122, 0.28);
  --gold: #f0cf7a;
  --cream: #fff4d6;
  --muted: #a9b6d8;
  --lamp: #ffd479;
}

* {
  box-sizing: border-box;
}

/* 화면에는 안 보이고 스크린리더만 읽는 글자 */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  color: var(--cream);
  background-color: var(--ground);
  line-height: 1.6;
}

/* ───────── 히어로 ───────── */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  background:
    linear-gradient(180deg, transparent 78%, var(--ground) 100%),
    linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 55%, var(--sky-low) 100%);
}

.hero-text {
  position: relative;
  z-index: 2;
  padding: 56px 20px 0;
  padding-top: clamp(28px, 7vh, 56px);
  padding-top: clamp(28px, 7svh, 56px);
  text-align: center;
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 13px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--muted);
}

.hero h1 {
  display: flex;
  flex-direction: column;
  margin: 0;
  font-family: "Noto Serif KR", "AppleMyungjo", "Batang", serif;
  font-size: clamp(56px, 16vw, 104px);
  /* 화면이 낮으면 제목을 줄여서 정자가 잘리지 않게 합니다. */
  font-size: clamp(44px, min(16vw, 11svh), 104px);
  font-weight: 900;
  line-height: 1.05;
  color: var(--gold);
  text-shadow: 0 0 24px rgba(240, 207, 122, 0.45);
}

.hero-sub {
  margin: 16px 0 20px;
  font-size: 15px;
  color: var(--cream);
  opacity: 0.9;
}

.hero-btn {
  display: inline-block;
  padding: 10px 28px;
  font-size: 15px;
  color: var(--gold);
  text-decoration: none;
  border: 1px solid var(--gold);
  border-radius: 999px;
  transition: background-color 0.3s, color 0.3s;
}

.hero-btn:hover,
.hero-btn:focus-visible {
  color: var(--sky-top);
  background-color: var(--gold);
}

.scene {
  position: relative;
  z-index: 1;
  width: min(100%, 760px);
  height: auto;
  max-height: 46vh;
  max-height: 46svh; /* 화면이 낮아도 장면 전체가 첫 화면에 들어오게 */
  margin-top: 16px;
}

/* 넓은 화면에서는 장면의 좌우 끝을 부드럽게 흐려서 가장자리가 보이지 않게 합니다. */
@media (min-width: 801px) {
  .scene {
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
  }
}

/* 달 */
.moon {
  position: absolute;
  top: 9%;
  right: 12%;
  z-index: 1;
  width: clamp(52px, 11vw, 84px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fffbe8, #f6e3a1 70%, #e8cf83);
  box-shadow: 0 0 40px 12px rgba(255, 233, 160, 0.3), 0 0 120px 40px rgba(255, 233, 160, 0.12);
}

/* 달빛 번짐: 그림자를 바꾸지 않고 투명도·크기만 바꿔서 폰에서도 가볍게 */
.moon::before {
  content: "";
  position: absolute;
  inset: -70%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 233, 160, 0.32), rgba(255, 233, 160, 0) 65%);
  animation: halo 6s ease-in-out infinite;
}

@keyframes halo {
  0%, 100% { opacity: 0.5; transform: scale(0.92); }
  50% { opacity: 1; transform: scale(1.1); }
}

/* 구름: 아주 천천히 흘러가는 옅은 구름 */
.clouds i {
  position: absolute;
  z-index: 0;
  left: -70%;
  width: 70%;
  height: 90px;
  background:
    radial-gradient(ellipse at 28% 55%, rgba(190, 210, 255, 0.2), transparent 62%),
    radial-gradient(ellipse at 68% 40%, rgba(190, 210, 255, 0.16), transparent 58%);
  filter: blur(8px);
  animation: drift 90s linear infinite;
}

.clouds i:nth-child(1) { top: 17%; animation-duration: 95s; animation-delay: -30s; }
.clouds i:nth-child(2) { top: 36%; height: 70px; animation-duration: 130s; animation-delay: -80s; }
.clouds i:nth-child(3) { top: 52%; height: 100px; animation-duration: 75s; animation-delay: -10s; }

@keyframes drift {
  from { transform: translateX(0); }
  to { transform: translateX(260vw); }
}

/* 별 */
.stars {
  position: absolute;
  inset: 0 0 30% 0;
  z-index: 0;
}

.star {
  position: absolute;
  border-radius: 50%;
  background-color: var(--lamp);
  opacity: 0.3;
  animation: twinkle 3s ease-in-out infinite;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.2; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.3); }
}

/* 별똥별 */
.shooting i {
  position: absolute;
  z-index: 0;
  width: 120px;
  height: 1.5px;
  background: linear-gradient(90deg, rgba(220, 235, 255, 0), rgba(220, 235, 255, 0.9));
  opacity: 0;
  transform: rotate(32deg);
  animation: shoot 9s linear infinite;
}

.shooting i:nth-child(1) { top: 8%;  left: 8%;  animation-delay: 1s; }
.shooting i:nth-child(2) { top: 22%; left: 40%; animation-delay: 4.5s; }
.shooting i:nth-child(3) { top: 14%; left: 62%; animation-delay: 7s; }

@keyframes shoot {
  0% { opacity: 0; transform: translate(0, 0) rotate(32deg); }
  3% { opacity: 1; }
  12% { opacity: 0; transform: translate(150px, 94px) rotate(32deg); }
  100% { opacity: 0; transform: translate(150px, 94px) rotate(32deg); }
}

/* 정자·고양이 */
.lit {
  animation: lantern 4s ease-in-out infinite;
}

.halo {
  animation: lantern 4s ease-in-out infinite;
}

@keyframes lantern {
  0%, 100% { opacity: 0.85; }
  45% { opacity: 1; }
  60% { opacity: 0.78; }
}

.shimmer {
  animation: shimmer 5s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% { opacity: 0.35; transform: translateX(-3px); }
  50% { opacity: 0.7; transform: translateX(3px); }
}

.cat-tail {
  transform-box: fill-box;
  transform-origin: 0% 100%;
  animation: tail 3.2s ease-in-out infinite;
}

@keyframes tail {
  0%, 100% { transform: rotate(-8deg); }
  50% { transform: rotate(12deg); }
}

.eye {
  transform-box: fill-box;
  transform-origin: center;
  animation: blink 4.5s infinite;
}

@keyframes blink {
  0%, 88%, 100% { transform: scaleY(1); }
  92%, 95% { transform: scaleY(0.08); }
}

/* ───────── 아이콘 ───────── */
.icon {
  width: 1.15em;
  height: 1.15em;
  margin-right: 0.35em;
  vertical-align: -0.2em;
  fill: currentColor;
}

/* 연못 위 연잎이 살짝 떠다니는 움직임 */
.pad {
  transform-box: fill-box;
  transform-origin: center;
  animation: bob 7s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: translate(0, 0) rotate(-2deg); }
  50% { transform: translate(7px, 2.5px) rotate(2deg); }
}

/* ───────── 메뉴판 ───────── */
.menu-section {
  max-width: 960px;
  margin: 0 auto;
  padding: 8px 16px 120px;
}

/* 기와 구분선: 첫 화면과 메뉴판 사이 */
.menu-section::before {
  content: "";
  display: block;
  height: 14px;
  margin: 0 -16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='14' viewBox='0 0 28 14'%3E%3Cpath d='M0 14 A14 14 0 0 1 28 14' fill='none' stroke='%23f0cf7a' stroke-opacity='.5' stroke-width='1.2'/%3E%3Cpath d='M5 14 A9 9 0 0 1 23 14' fill='none' stroke='%23f0cf7a' stroke-opacity='.28' stroke-width='1'/%3E%3C/svg%3E") repeat-x center bottom;
}

.board-head {
  padding: 24px 0 4px;
  text-align: center;
}

/* 단청 색(청·적·황)을 옅게 쓴 띠 */
.board-title::after {
  content: "";
  display: block;
  width: 132px;
  height: 4px;
  margin: 10px auto 6px;
  border-radius: 2px;
  background: linear-gradient(90deg, #2f7f78 0 25%, #c8493f 25% 50%, #f0cf7a 50% 75%, #2f7f78 75% 100%);
  opacity: 0.75;
}

.ornament {
  margin: 0;
  color: var(--gold);
  font-size: 22px;
}

.ornament .icon {
  margin: 0 6px;
  color: #5fae98;
}

.ornament .icon.big {
  width: 1.7em;
  height: 1.7em;
  color: #f2c4cf;
}

.ornament .icon.flip {
  transform: scaleX(-1);
}

.board-title {
  margin: 4px 0 0;
  font-family: "Noto Serif KR", "AppleMyungjo", "Batang", serif;
  font-size: 30px;
  letter-spacing: 6px;
  color: var(--gold);
}

.board-sub {
  margin: 0;
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--muted);
}

.table-info {
  margin: 12px 0 0;
  font-size: 14px;
  color: var(--muted);
}

#menu {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 16px;
  align-items: start;
}

.tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 12px 0;
  background: linear-gradient(180deg, var(--ground) 70%, rgba(11, 21, 48, 0));
}

.tab {
  min-width: 96px;
  padding: 10px 22px;
  font-size: 16px;
  font-family: inherit;
  color: var(--cream);
  background-color: transparent;
  border: 1px solid var(--panel-line);
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s;
}

.tab.minor {
  min-width: 64px;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--muted);
}

.tab:hover {
  border-color: var(--gold);
}

.tab.active {
  --vein: var(--gold);
  color: var(--sky-top);
  background-color: var(--gold);
  border-color: var(--gold);
  font-weight: 700;
}

.tab:focus-visible,
a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--lamp);
  outline-offset: 2px;
}

.category {
  margin-top: 0;
  padding: 16px 18px;
  background-color: var(--panel);
  /* 창살 무늬: 아주 옅은 격자 */
  background-image:
    linear-gradient(rgba(240, 207, 122, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(240, 207, 122, 0.045) 1px, transparent 1px);
  background-size: 22px 22px;
  border: 1px solid var(--panel-line);
  border-radius: 14px;
  animation: fade-up 0.5s ease both;
}

.category.minor-note {
  background-color: rgba(17, 31, 74, 0.6);
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.category h2 {
  margin: 0 0 4px;
  padding-bottom: 8px;
  font-family: "Noto Serif KR", "AppleMyungjo", "Batang", serif;
  font-size: 20px;
  color: var(--gold);
  border-bottom: 1px solid var(--panel-line);
}

.category h2 .icon {
  color: #f2c4cf;
}

.minor-label {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.items {
  margin: 0;
  padding: 0;
  list-style: none;
}

.item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px dashed var(--panel-line);
}

.item:last-child {
  border-bottom: none;
}

.item-top {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
}

/* 이름과 가격 사이 점선 (메뉴판 느낌) */
.leader {
  flex: 1 1 12px;
  min-width: 12px;
  border-bottom: 1px dotted var(--panel-line);
  transform: translateY(-4px);
}

.item-name {
  font-size: 17px;
  font-weight: 700;
}

.item-desc {
  grid-column: 1;
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.item-buy {
  grid-column: 2;
  grid-row: 2;
}

.item-price {
  font-weight: 700;
  color: var(--lamp);
}

.add-btn {
  min-width: 60px;
  min-height: 36px;
  padding: 7px 16px;
  font-size: 14px;
  font-family: inherit;
  color: var(--sky-top);
  background-color: var(--gold);
  border: none;
  border-radius: 999px;
  cursor: pointer;
}

.add-btn.added {
  background-color: #c9d96a;
}

.badge {
  padding: 1px 8px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
}

.badge.hot { color: #ffb4a6; background-color: rgba(255, 120, 100, 0.18); }
.badge.iced { color: #a9d8ff; background-color: rgba(110, 180, 255, 0.18); }
.badge.signature { color: var(--sky-top); background-color: var(--gold); }
.badge.recommended { color: #bfe9dc; background-color: rgba(95, 174, 152, 0.25); }
.badge.soldout { color: var(--cream); background-color: rgba(169, 182, 216, 0.28); }

/* 품절 메뉴: 흐리게, 가격에 줄, 담기 버튼 막기 */
.item.sold-out .item-name,
.item.sold-out .item-desc,
.item.sold-out .item-price {
  opacity: 0.5;
}

.item.sold-out .item-price {
  text-decoration: line-through;
}

.add-btn:disabled {
  color: var(--muted);
  background-color: transparent;
  border: 1px solid var(--panel-line);
  cursor: not-allowed;
}

/* ───────── 장바구니 바 ───────── */
.cart-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 16px;
  z-index: 10;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(calc(100% - 24px), 520px);
  padding: 10px 12px 10px 20px;
  background-color: rgba(6, 13, 38, 0.95);
  border: 1px solid var(--gold);
  border-radius: 999px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  animation: fade-up 0.4s ease both;
}

.cart-bar[hidden] {
  display: none;
}

.cart-summary {
  margin: 0;
  font-size: 14px;
}

.cart-summary strong {
  color: var(--lamp);
}

.cart-open {
  min-height: 40px;
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  color: var(--sky-top);
  background-color: var(--gold);
  border: none;
  border-radius: 999px;
  cursor: pointer;
}

/* ───────── 주문 창 ───────── */
dialog {
  width: min(calc(100% - 24px), 480px);
  max-height: 86vh;
  padding: 0;
  color: var(--cream);
  background-color: var(--panel);
  border: 1px solid var(--gold);
  border-radius: 16px;
}

dialog::backdrop {
  background-color: rgba(3, 7, 20, 0.7);
}

.order {
  padding: 20px;
}

.order h2 {
  margin: 0 0 4px;
  font-family: "Noto Serif KR", "AppleMyungjo", "Batang", serif;
  color: var(--gold);
}

.order-table {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--muted);
}

.order-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.order-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--panel-line);
}

.order-name {
  flex: 1;
}

.qty {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qty button {
  width: 36px;
  height: 36px;
  font-size: 16px;
  font-family: inherit;
  color: var(--gold);
  background: transparent;
  border: 1px solid var(--panel-line);
  border-radius: 50%;
  cursor: pointer;
}

.order-line-price {
  min-width: 72px;
  text-align: right;
  color: var(--lamp);
}

.order-total {
  display: flex;
  justify-content: space-between;
  margin: 14px 0;
  font-size: 18px;
  font-weight: 700;
}

.order-total span:last-child {
  color: var(--lamp);
}

.order-actions {
  display: flex;
  gap: 8px;
}

.order-actions button {
  flex: 1;
  padding: 12px;
  font-size: 15px;
  font-family: inherit;
  border-radius: 999px;
  cursor: pointer;
}

.btn-ghost {
  color: var(--cream);
  background: transparent;
  border: 1px solid var(--panel-line);
}

.btn-main {
  font-weight: 700;
  color: var(--sky-top);
  background-color: var(--gold);
  border: 1px solid var(--gold);
}

.done-note {
  margin: 8px 0 16px;
  color: var(--muted);
  font-size: 14px;
}

/* ───────── 푸터 ───────── */
.site-footer {
  padding: 20px 16px 96px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

.site-footer p {
  margin: 2px 0;
}

/* 움직임을 줄이고 싶은 사용자 설정 존중 */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .star {
    opacity: 0.7;
  }
}
