/* ============================================================
   하루의 사주명당 — 공통 스타일
   ------------------------------------------------------------
   · 모바일 세로 우선. 데스크톱은 가운데 한 칸으로 본다.
   · 색은 토큰으로만 쓴다. 라이트/다크 둘 다 토큰 값만 바꾼다.
   · 오행 색은 전통 오방색(청·적·황·백·흑)에서 가져왔다.
   ============================================================ */

/* ★ 웹폰트를 바깥에서 받아 오지 않는다.
     예전에는 여기서 jsDelivr(해외 CDN)의 Pretendard 를 @import 했다.
     그러면 어느 메뉴를 열든 방문자의 IP 가 제3자에게 전달된다.
     "계산도 데이터도 전부 우리 안에 있다"는 이 사이트의 전제와 어긋나고,
     개인정보처리방침의 "제3자 제공 없음"도 사실이 아니게 된다.
     그래서 기기에 이미 깔린 글꼴만 쓴다. 아래 목록은 위에서부터 찾는다. */

:root {
  --bg:        #F5F4F8;
  --surface:   #FFFFFF;
  --surface-2: #FAF9FC;
  --line:      #E4E2EC;
  --ink:       #1B1826;
  --ink-2:     #443F55;
  --muted:     #6A6478;
  --accent:    #4B3FA8;
  --accent-in: #FFFFFF;
  --accent-bg: #EDEAFB;
  --gold:      #A87C2E;

  --el-wood:  #3F8F63;
  --el-fire:  #C9524A;
  --el-earth: #B0842F;
  --el-metal: #7B8194;
  --el-water: #3A62A8;

  --shadow-1: 0 1px 2px rgba(27,24,38,.05);
  --shadow-2: 0 2px 4px rgba(27,24,38,.05), 0 12px 28px rgba(27,24,38,.07);
  --r:  12px;
  --r-lg: 18px;

  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
          system-ui, "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:        #111019;
    --surface:   #1A1826;
    --surface-2: #211E30;
    --line:      #2E2B3E;
    --ink:       #EBE9F3;
    --ink-2:     #C3BFD3;
    --muted:     #9A94AC;
    --accent:    #A99BF0;
    --accent-in: #17142A;
    --accent-bg: #262040;
    --gold:      #D8AC5C;

    --el-wood:  #57B583;
    --el-fire:  #E4756C;
    --el-earth: #D3A75A;
    --el-metal: #9AA0B3;
    --el-water: #6A93D8;

    --shadow-1: 0 1px 2px rgba(0,0,0,.4);
    --shadow-2: 0 2px 4px rgba(0,0,0,.35), 0 12px 28px rgba(0,0,0,.35);
  }
}

:root[data-theme="dark"] {
  --bg:        #111019;
  --surface:   #1A1826;
  --surface-2: #211E30;
  --line:      #2E2B3E;
  --ink:       #EBE9F3;
  --ink-2:     #C3BFD3;
  --muted:     #9A94AC;
  --accent:    #A99BF0;
  --accent-in: #17142A;
  --accent-bg: #262040;
  --gold:      #D8AC5C;

  --el-wood:  #57B583;
  --el-fire:  #E4756C;
  --el-earth: #D3A75A;
  --el-metal: #9AA0B3;
  --el-water: #6A93D8;

  --shadow-1: 0 1px 2px rgba(0,0,0,.4);
  --shadow-2: 0 2px 4px rgba(0,0,0,.35), 0 12px 28px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.72;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ── 뼈대 ───────────────────────────────────────────────── */
.wrap { max-width: 560px; margin: 0 auto; padding: 0 18px; }
.wrap-wide { max-width: 900px; margin: 0 auto; padding: 0 18px; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-in {
  max-width: 560px; margin: 0 auto; padding: 12px 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand {
  font-size: 19px; font-weight: 800; letter-spacing: -0.03em;
  color: var(--ink); text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand .dot { color: var(--accent); }

/* ── 글 ─────────────────────────────────────────────────── */
h1, h2, h3 { margin: 0; letter-spacing: -0.035em; text-wrap: balance; }
h1 { font-size: clamp(25px, 6.2vw, 32px); font-weight: 800; line-height: 1.3; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 17px; font-weight: 700; }
p  { margin: 0; }

.eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: .14em;
  color: var(--accent); text-transform: uppercase;
}
.lead { color: var(--muted); font-size: 15.5px; }
/* ★ hidden 속성은 브라우저 기본 규칙(display:none)이라, .hero{display:block} .stack{display:flex} 같은 우리 규칙이
   이겨 버린다 — 실제로 "자세한 표"를 열어도 위의 메뉴 배너가 그대로 보였다(2026-09-03). 항상 이기게 못박는다. */
[hidden] { display: none !important; }
.stack   { display: flex; flex-direction: column; gap: 12px; }
.stack-lg{ display: flex; flex-direction: column; gap: 28px; }
.section { padding: 30px 0; }

/* ── 카드 ───────────────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-1);
  padding: 18px;
}

/* ── 메뉴 격자 ──────────────────────────────────────────── */
.menu-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.menu-item {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  border-radius: var(--r-lg); border: 1px solid var(--line);
  background: var(--surface); box-shadow: var(--shadow-1);
  text-decoration: none; color: inherit;
  transition: transform .16s ease, box-shadow .16s ease;
}
.menu-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); text-decoration: none; }
.menu-item .body { padding: 11px 12px 13px; display: flex; flex-direction: column; gap: 3px; flex: 1 1 auto; justify-content: center; }
.menu-item .t { font-size: 15.5px; font-weight: 700; letter-spacing: -0.03em; }
.menu-item .s { font-size: 12.5px; color: var(--muted); line-height: 1.5; letter-spacing: -0.02em; }
.menu-item .badge {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  background: var(--accent); color: var(--accent-in);
  font-size: 11px; font-weight: 700; letter-spacing: -0.01em;
  padding: 3px 8px; border-radius: 999px;
}

/* ── 입력 ───────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label { font-size: 13.5px; font-weight: 700; color: var(--ink-2); }
.hint { font-size: 12.5px; color: var(--muted); line-height: 1.6; }

input[type="number"], input[type="text"], input[type="date"], select {
  width: 100%; padding: 12px 13px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r);
  font-family: inherit; font-size: 16px; line-height: 1.4;
  appearance: none;
}
input:focus, select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-bg); }

.row { display: grid; gap: 10px; }
.row-3 { grid-template-columns: 1.2fr 1fr 1fr; }
.row-2 { grid-template-columns: 1fr 1fr; }

.choice { display: flex; flex-wrap: wrap; gap: 8px; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice label {
  padding: 9px 15px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink-2);
  font-size: 14.5px; font-weight: 600; cursor: pointer;
  transition: background .14s ease, border-color .14s ease, color .14s ease;
}
.choice input:checked + label { background: var(--accent); border-color: var(--accent); color: var(--accent-in); }
.choice input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  width: 100%; padding: 15px 18px; border: 0; border-radius: var(--r);
  background: var(--accent); color: var(--accent-in);
  font-family: inherit; font-size: 16.5px; font-weight: 700; letter-spacing: -0.02em;
  cursor: pointer; transition: filter .14s ease;
}
.btn:hover { filter: brightness(1.07); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-ghost { background: transparent; color: var(--accent); border: 1px solid var(--line); }

/* ── 사주 원국 표 ───────────────────────────────────────── */
.pillars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pillar { text-align: center; display: flex; flex-direction: column; gap: 6px; }
.pillar .pos { font-size: 12px; font-weight: 700; color: var(--muted); }
.pillar .gz {
  border: 1px solid var(--line); border-radius: var(--r); padding: 10px 0 12px;
  background: var(--surface-2); display: flex; flex-direction: column; gap: 2px;
}
.pillar .han { font-size: 30px; font-weight: 700; line-height: 1.15; }
.pillar .kor { font-size: 12.5px; color: var(--muted); }
.pillar .sip { font-size: 11.5px; color: var(--muted); }

.el-목 { color: var(--el-wood); }
.el-화 { color: var(--el-fire); }
.el-토 { color: var(--el-earth); }
.el-금 { color: var(--el-metal); }
.el-수 { color: var(--el-water); }

.bars { display: flex; flex-direction: column; gap: 8px; }
.bar { display: grid; grid-template-columns: 26px 1fr 42px; align-items: center; gap: 10px; }
.bar .name { font-weight: 800; font-size: 14px; }
.bar .track { height: 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.bar .fill { display: block; height: 100%; border-radius: 999px; }
.bar .num { font-size: 12.5px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }

/* ── 표 ─────────────────────────────────────────────────── */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
table.data th { color: var(--muted); font-weight: 700; font-size: 12.5px; }
table.data td { font-variant-numeric: tabular-nums; }
/* 눈에 띄어야 하는 줄 (절기 달력의 節, 직업운의 으뜸 갈래) */
table.data tr.mark td { background: var(--accent-bg); }

/* ── 알림 ───────────────────────────────────────────────── */
.notice {
  display: flex; gap: 9px; padding: 12px 14px; border-radius: var(--r);
  background: var(--accent-bg); color: var(--ink-2); font-size: 13.5px; line-height: 1.65;
}
.notice .ico { flex: 0 0 auto; }
.err { background: color-mix(in srgb, var(--el-fire) 12%, transparent); }

.dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; margin: 0; }
.dl dt { color: var(--muted); white-space: nowrap; }
.dl dd { margin: 0; font-variant-numeric: tabular-nums; }

/* ── 바닥 ───────────────────────────────────────────────── */
.foot {
  margin-top: 44px; padding: 24px 0 40px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 13px; line-height: 1.9; text-align: center;
}
.foot a { color: var(--muted); }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}


/* ============================================================
   페이지 배경 그림 — 사이트 곳곳에 만화사주 그림을 깐다
   ------------------------------------------------------------
   ★ 원칙: 그림은 뒤에만 있고, 글은 언제나 불투명한 판 위에 올린다.
     그림 위에 글을 바로 올리면 읽기가 나빠진다.
   ============================================================ */
.page-art { position: fixed; inset: 0; z-index: -3; overflow: hidden; pointer-events: none; }
.page-art img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: .46; /* 움직임 없음 — 사장님 지시. 확대·이동 애니메이션을 전부 뗐다. */
}
:root[data-theme="dark"] .page-art img { opacity: .34; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .page-art img { opacity: .34; }
}
/* 그림 위에 바탕색을 옅게 덮어 글 읽는 영역을 차분하게 만든다 */
.page-art::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom,
    color-mix(in srgb, var(--bg) 66%, transparent) 0%,
    color-mix(in srgb, var(--bg) 48%, transparent) 45%,
    color-mix(in srgb, var(--bg) 80%, transparent) 100%);
}
@media (prefers-reduced-motion: reduce) { .page-art img { animation: none; } }

/* ============================================================
   동적 배경 · 배너 · 메뉴 카드
   ============================================================ */

#bgfx {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: -1; pointer-events: none; display: block;
}
body { position: relative; }

/* ── 큰 배너 ────────────────────────────────────────────── */
.hero {
  position: relative; display: block; overflow: hidden;
  border-radius: 20px; border: 1px solid var(--line);
  box-shadow: var(--shadow-2); text-decoration: none; color: inherit;
  background: var(--surface-2);
  aspect-ratio: 3 / 4;
}
.hero:hover { text-decoration: none; }
.hero img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; will-change: transform;
}
.hero .cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 16px 18px 18px;
  background: linear-gradient(to top, rgba(8,10,18,.86), rgba(8,10,18,0));
  color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.hero .cap .d { font-size: 14px; opacity: .92; letter-spacing: -0.02em; }
.hero .cap .go { font-size: 14.5px; font-weight: 800; white-space: nowrap; }

/* ── 메뉴 카드 ──────────────────────────────────────────── */
.menu-item .shot { display: block; position: relative; overflow: hidden; aspect-ratio: 2 / 3; background: var(--surface-2); flex: 0 0 auto; }
.menu-item .shot img { width: 100%; height: 100%; object-fit: cover; display: block; will-change: transform; }
.menu-item.soon .shot img { filter: saturate(.72) brightness(.86); }
.menu-item.soon { cursor: default; }
.menu-item .badge.wait { background: color-mix(in srgb, var(--ink) 62%, transparent); color: #fff; }

/* 천천히 커졌다 작아지는 움직임 — GPU 합성(transform)만 쓴다.
   자바스크립트 없이 CSS 로만 돌린다. 화면 밖 요소는 브라우저가 알아서 건너뛴다.
   카드마다 시작 시점을 어긋나게 해 한꺼번에 같이 움직이지 않게 한다. */
/* 아주 천천히, 아주 조금만 움직인다.
   크게 흔들리면 글을 읽기 어렵고 어지럽다. "살아 있다" 정도만 느껴지면 된다. */
/* ★ 움직임은 "있는 듯 없는 듯"이어야 한다. 처음엔 110초에 2.2% 였는데 눈이 아프다는 말을 들었다.
     주기 20배, 폭 5배 → 체감 100분의 1. 이 아래로는 그냥 정지 그림과 구분이 안 된다. */
@keyframes drift {
  0%   { transform: scale(1.000) translate3d(0, 0, 0); }
  50%  { transform: scale(1.004) translate3d(0, -0.08%, 0); }
  100% { transform: scale(1.000) translate3d(0, 0, 0); }
}
.menu-item .shot img { animation: none; }   /* 홈 카드는 정지 — 눈 아프다는 지시 */

/* ┌────────────────────────────────────────────────────────────┐
   │  ★ 메뉴 첫 그림 "동영상처럼" (사장님용 조절) — 단위 필수         │
   │    --hero-move  카메라가 한쪽 끝까지 가는 시간  28s  (18s 빠르게)   │
   │    --hero-zoom  얼마나 다가가나              1.08 (1.04 살짝)    │
   │    --hero-sheen 빛이 한 번 스치는 주기          9s   (0s 없음)      │
   └────────────────────────────────────────────────────────────┘ */
:root { --hero-move: 28s; --hero-zoom: 1.08; --hero-sheen: 9s; }
.hero img {
  animation: hero-live var(--hero-move) ease-in-out infinite alternate;
  transform-origin: 50% 30%;
}
@keyframes hero-live {
  from { transform: scale(1)                translate3d(0, 0, 0); }
  to   { transform: scale(var(--hero-zoom)) translate3d(-1.5%, 1.2%, 0); }
}
/* 빛이 한 번씩 스쳐 지나간다 — 정지 그림이 아니라는 느낌 */
.hero::after {
  content: ''; position: absolute; inset: -40%; z-index: 1; pointer-events: none;
  background: linear-gradient(115deg, transparent 42%, rgba(255,255,255,.13) 50%, transparent 58%);
  transform: translateX(-70%);
  animation: hero-sheen var(--hero-sheen) ease-in-out infinite;
}
@keyframes hero-sheen { 0%, 62% { transform: translateX(-70%); } 100% { transform: translateX(70%); } }
.hero .cap { z-index: 2; }








@media (prefers-reduced-motion: reduce) {
  .hero img, .hero::after, .menu-item .shot img { animation: none; }
}
