/* =========================================================
   한옥아카데미 — 모바일 디자인 시스템
   구조/간격/컴포넌트 규칙은 Wanted Montage 디자인 시스템을 참고,
   색·질감은 한옥(단청·한지·먹) 정체성에 맞춰 재구성했습니다.
   ========================================================= */

:root {
  /* --- Color tokens (전통 한옥 황토·갈색 계열) --- */
  --bg:        #F6EEE1;   /* 황토빛 한지 배경 */
  --surface:   #FFFDF8;
  --surface-2: #F1E7D6;
  --border:    #E8DAC4;
  --border-2:  #DCCBAF;

  --ink:   #2C2218;       /* 먹갈색 */
  --ink-2: #6E5C46;
  --ink-3: #9E8C72;
  --ink-on:#FFFFFF;

  --brand:       #8A5A2B; /* 황토 갈색 (주조색) */
  --brand-strong:#6E4520;
  --brand-soft:  #F0E2CC;
  --accent:      #B24A28; /* 주칠 적갈색 (강조) */
  --accent-soft: #F8E6D9;
  --wood:        #A6794E;
  --gold:        #C29A3E;

  /* --- Radius --- */
  --r-sm: 8px;  --r-md: 12px;  --r-lg: 16px;  --r-xl: 22px;  --r-pill: 999px;

  /* --- Shadow --- */
  --sh-1: 0 1px 2px rgba(27,23,20,.05), 0 1px 3px rgba(27,23,20,.04);
  --sh-2: 0 4px 16px rgba(27,23,20,.08);
  --sh-3: 0 12px 32px rgba(27,23,20,.14);

  --app-max: 480px;
  --appbar-h: 56px;
  --tabbar-h: 64px;
  --ease: cubic-bezier(.22,.61,.36,1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Pretendard Variable", Pretendard, -apple-system, system-ui, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  color: var(--ink);
  background: #E9E3D9;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
ul { margin: 0; padding: 0; list-style: none; }

/* ===== 데스크톱 디바이스 프레임 ===== */
.device-stage {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(1200px 600px at 50% -10%, #EFE4D0 0%, #E0D2B8 55%, #D6C4A4 100%);
}
.device {
  position: relative;
  width: 100%;
  max-width: var(--app-max);
  height: min(880px, 94dvh);
  background: var(--bg);
  border-radius: 44px;
  box-shadow: var(--sh-3), 0 0 0 11px #14110E, 0 0 0 13px #2A241E;
  overflow: hidden;
}
.device__notch {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 150px; height: 26px; background: #14110E;
  border-radius: 0 0 18px 18px; z-index: 60;
}
.app { position: relative; height: 100%; display: flex; flex-direction: column; }

/* On real phones, drop the desk frame */
@media (max-width: 540px) {
  .device-stage { padding: 0; background: var(--bg); }
  .device { max-width: 100%; height: 100dvh; border-radius: 0; box-shadow: none; }
  .device__notch { display: none; }
}

/* ===== 앱바 ===== */
.appbar {
  height: var(--appbar-h);
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 8px;
  padding: 0 8px 0 14px;
  background: rgba(250,248,244,.86);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
  position: relative; z-index: 40;
}
.appbar__back { width: 40px; height: 40px; display: grid; place-items: center; border-radius: var(--r-pill); color: var(--ink); }
.appbar__back:active { background: var(--surface-2); }
.appbar__brand { display: flex; align-items: center; gap: 9px; flex: 1 1 auto; min-width: 0; }
.appbar__logo {
  width: 30px; height: 30px; flex: 0 0 auto; display: grid; place-items: center;
  background: var(--brand); color: #fff; border-radius: 9px;
  font-weight: 800; font-size: 16px; letter-spacing: -.5px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}
.appbar__title { font-weight: 800; font-size: 17px; letter-spacing: -.4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar__icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: var(--r-pill); color: var(--brand); }
.appbar__icon:active { background: var(--brand-soft); }

/* ===== 스크린 ===== */
.screen {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px);
  outline: none;
  scroll-behavior: smooth;
}
.screen::-webkit-scrollbar { width: 0; }
.view { animation: fade .32s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ===== 공통 레이아웃 ===== */
.section { padding: 22px 18px 4px; }
.section + .section { padding-top: 10px; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 13px; }
.section__title { font-size: 18px; font-weight: 800; letter-spacing: -.5px; }
.section__more { font-size: 13px; color: var(--ink-3); font-weight: 600; }
.section__more:active { color: var(--brand); }
.eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .4px; color: var(--brand); text-transform: none; }

/* ===== 배지/태그 ===== */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  height: 23px; padding: 0 9px; border-radius: var(--r-pill);
  font-size: 11.5px; font-weight: 800; letter-spacing: -.2px; white-space: nowrap;
}
.badge--brand  { background: var(--brand-soft); color: var(--brand-strong); }
.badge--accent { background: var(--accent-soft); color: var(--accent); }
.badge--wood   { background: #F0E8DD; color: var(--wood); }
.badge--ghost  { background: var(--surface-2); color: var(--ink-2); }

/* ===== 버튼 ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 50px; padding: 0 20px; border-radius: var(--r-md);
  font-size: 15.5px; font-weight: 700; letter-spacing: -.3px;
  transition: transform .12s var(--ease), background .15s;
  width: 100%;
}
.btn:active { transform: scale(.975); }
.btn--primary { background: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(31,111,92,.28); }
.btn--primary:active { background: var(--brand-strong); }
.btn--accent { background: var(--accent); color: #fff; box-shadow: 0 6px 16px rgba(192,73,46,.26); }
.btn--ghost { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--border-2); }
.btn--sm { height: 40px; font-size: 14px; padding: 0 16px; }

/* ===== 카드 공통 ===== */
.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  border: 1px solid var(--border);
  overflow: hidden;
}

/* ===== HERO ===== */
.hero {
  position: relative;
  margin: 14px 18px 4px;
  border-radius: var(--r-xl);
  overflow: hidden;
  color: #fff;
  box-shadow: var(--sh-2);
  background: linear-gradient(150deg, #A0703A 0%, #8A5A2B 45%, #5E3D1C 100%);
  min-height: 264px;
  display: flex; flex-direction: column; justify-content: flex-end;
}
.hero__art { position: absolute; inset: 0; opacity: .9; }
.hero__scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(36,24,12,.15) 0%, rgba(34,22,10,0) 34%, rgba(30,19,8,.58) 72%, rgba(26,16,6,.82) 100%); }
.hero__body { position: relative; padding: 20px 20px 22px; }
.hero__eyebrow { font-size: 12.5px; font-weight: 800; letter-spacing: .3px; opacity: .95; margin-bottom: 10px; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; background: rgba(40,26,12,.32); border-radius: var(--r-pill); backdrop-filter: blur(2px); }
.hero__title { font-size: 27px; line-height: 1.28; font-weight: 800; letter-spacing: -.8px; margin: 0 0 9px; text-shadow: 0 2px 16px rgba(0,0,0,.4); white-space: pre-line; }
.hero__sub { font-size: 13.5px; line-height: 1.6; opacity: .95; white-space: pre-line; text-shadow: 0 1px 8px rgba(0,0,0,.45); }
.hero__cta { margin-top: 16px; display: flex; gap: 9px; }
.hero__cta .btn { width: auto; flex: 1; }
.hero__cta .btn--ghost { background: rgba(255,255,255,.16); color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.4); backdrop-filter: blur(2px); }

/* ===== 빠른 메뉴 (그리드) ===== */
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 18px 14px 4px; }
.quick__item { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 4px; border-radius: var(--r-md); }
.quick__item:active { background: var(--surface-2); }
.quick__ico {
  width: 50px; height: 50px; border-radius: 16px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-strong);
}
.quick__ico svg { width: 26px; height: 26px; }
.quick__ico--a { background: var(--accent-soft); color: var(--accent); }
.quick__ico--w { background: #F0E8DD; color: var(--wood); }
.quick__ico--g { background: #F6EFD8; color: #A07D1E; }
.quick__label { font-size: 12px; font-weight: 700; color: var(--ink-2); letter-spacing: -.3px; }

/* ===== 과정 카드 (가로 스크롤) ===== */
.hscroll { display: flex; gap: 12px; overflow-x: auto; padding: 2px 18px 8px; scroll-snap-type: x mandatory; }
.hscroll::-webkit-scrollbar { display: none; }
.course-card { flex: 0 0 78%; scroll-snap-align: start; }
.course-card__art { height: 132px; position: relative; }
.course-card__tag { position: absolute; top: 11px; left: 11px; }
.course-card__body { padding: 14px 15px 16px; }
.course-card__title { font-size: 16px; font-weight: 800; letter-spacing: -.5px; margin: 0 0 4px; }
.course-card__sub { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; margin: 0 0 12px; }
.course-card__meta { display: flex; gap: 12px; font-size: 12px; color: var(--ink-3); }
.course-card__meta b { color: var(--ink-2); font-weight: 700; }

/* ===== 과정 리스트 (전체 페이지) ===== */
.course-row {
  display: flex; gap: 13px; padding: 14px; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
}
.course-row:active { transform: scale(.99); }
.course-row__thumb { flex: 0 0 76px; width: 76px; height: 76px; border-radius: var(--r-md); overflow: hidden; }
.course-row__info { flex: 1 1 auto; min-width: 0; }
.course-row__title { font-size: 15.5px; font-weight: 800; letter-spacing: -.4px; margin: 4px 0 3px; }
.course-row__sub { font-size: 12.5px; color: var(--ink-2); line-height: 1.45; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.course-row__chev { flex: 0 0 auto; color: var(--ink-3); }
.stack { display: flex; flex-direction: column; gap: 11px; padding: 4px 18px; }

/* ===== 공지 리스트 ===== */
.notice-list { padding: 4px 18px; }
.notice-item { display: flex; align-items: center; gap: 12px; padding: 16px 4px; border-bottom: 1px solid var(--border); }
.notice-item:active { background: var(--surface-2); }
.notice-item__dot { flex: 0 0 auto; }
.notice-item__main { flex: 1 1 auto; min-width: 0; }
.notice-item__title { font-size: 14.5px; font-weight: 700; letter-spacing: -.4px; margin: 0 0 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notice-item__date { font-size: 12px; color: var(--ink-3); }
.notice-item__chev { color: var(--ink-3); }

/* ===== 갤러리 ===== */
.gallery-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 6px 18px; }
.gal { border-radius: var(--r-md); overflow: hidden; position: relative; aspect-ratio: 1/1; box-shadow: var(--sh-1); }
.gal__cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 11px 9px; color: #fff;
  background: linear-gradient(180deg, transparent, rgba(15,25,21,.72)); font-size: 12px; font-weight: 700; letter-spacing: -.3px; }
.gal__cat { position: absolute; top: 8px; left: 8px; }

/* ===== 상세 페이지 ===== */
.detail-hero { height: 200px; position: relative; display: flex; align-items: flex-end; }
.detail-hero__body { position: relative; padding: 16px 18px; color: #fff; }
.detail-hero__title { font-size: 22px; font-weight: 800; letter-spacing: -.6px; margin: 8px 0 4px; text-shadow: 0 2px 10px rgba(0,0,0,.25); }
.detail-hero__sub { font-size: 13px; opacity: .94; }
.detail-body { padding: 18px; }
.lead { font-size: 14.5px; line-height: 1.7; color: var(--ink-2); margin: 0 0 18px; }

.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); border-radius: var(--r-md); overflow: hidden; margin-bottom: 20px; }
.info-cell { background: var(--surface); padding: 13px 14px; }
.info-cell__k { font-size: 11.5px; font-weight: 700; color: var(--ink-3); margin-bottom: 5px; }
.info-cell__v { font-size: 13.5px; font-weight: 700; color: var(--ink); letter-spacing: -.3px; }

.curri { display: flex; flex-direction: column; gap: 0; }
.curri__item { display: flex; gap: 13px; padding: 12px 0; }
.curri__num { flex: 0 0 26px; height: 26px; border-radius: var(--r-pill); background: var(--brand-soft); color: var(--brand-strong); font-size: 12.5px; font-weight: 800; display: grid; place-items: center; }
.curri__text { font-size: 14px; line-height: 1.45; padding-top: 3px; font-weight: 600; }

.subhead { font-size: 16px; font-weight: 800; letter-spacing: -.5px; margin: 4px 0 12px; display: flex; align-items: center; gap: 8px; }
.subhead::before { content: ""; width: 4px; height: 16px; border-radius: 3px; background: var(--brand); }

.notice-detail__meta { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.notice-detail__title { font-size: 20px; font-weight: 800; letter-spacing: -.5px; line-height: 1.4; margin: 10px 0 14px; }
.notice-detail__body { font-size: 14.5px; line-height: 1.8; color: var(--ink-2); white-space: pre-line; }

/* ===== 더보기 ===== */
.profile-card { margin: 16px 18px 6px; padding: 20px; display: flex; gap: 15px; align-items: center;
  background: linear-gradient(140deg, #fff, #FBF7F0); }
.profile-card__logo { width: 54px; height: 54px; border-radius: 15px; background: var(--brand); color: #fff;
  display: grid; place-items: center; font-size: 26px; font-weight: 800; box-shadow: var(--sh-2); }
.profile-card__name { font-size: 17px; font-weight: 800; letter-spacing: -.5px; }
.profile-card__legal { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; }

.menu-group { margin: 14px 18px; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--sh-1); }
.menu-row { display: flex; align-items: center; gap: 13px; padding: 16px 16px; border-bottom: 1px solid var(--border); }
.menu-row:last-child { border-bottom: none; }
.menu-row:active { background: var(--surface-2); }
.menu-row__ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--brand); flex: 0 0 auto; }
.menu-row__ico svg { width: 19px; height: 19px; }
.menu-row__label { flex: 1 1 auto; font-size: 14.5px; font-weight: 700; letter-spacing: -.3px; }
.menu-row__sub { font-size: 12px; color: var(--ink-3); }
.menu-row__chev { color: var(--ink-3); }

.faq-item { border-bottom: 1px solid var(--border); }
.faq-q { display: flex; align-items: center; gap: 11px; padding: 16px 4px; width: 100%; text-align: left; }
.faq-q__mark { color: var(--brand); font-weight: 800; flex: 0 0 auto; }
.faq-q__text { flex: 1 1 auto; font-size: 14.5px; font-weight: 700; letter-spacing: -.3px; }
.faq-q__chev { color: var(--ink-3); transition: transform .25s var(--ease); }
.faq-item.is-open .faq-q__chev { transform: rotate(180deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .3s var(--ease); }
.faq-a__inner { padding: 0 4px 16px 32px; font-size: 13.5px; line-height: 1.7; color: var(--ink-2); }

.contact-card { margin: 4px 18px; }
.contact-row { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); align-items: flex-start; }
.contact-row:last-child { border-bottom: none; }
.contact-row__ico { color: var(--brand); flex: 0 0 auto; margin-top: 1px; }
.contact-row__k { font-size: 11.5px; color: var(--ink-3); font-weight: 700; margin-bottom: 3px; }
.contact-row__v { font-size: 14px; font-weight: 600; letter-spacing: -.2px; line-height: 1.5; }

.map-card { margin: 14px 18px; height: 160px; border-radius: var(--r-lg); overflow: hidden; position: relative; box-shadow: var(--sh-1); border: 1px solid var(--border); }
.map-pin { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-100%); color: var(--accent); filter: drop-shadow(0 4px 6px rgba(0,0,0,.25)); }

.greeting-body { padding: 20px 20px 8px; font-size: 14.5px; line-height: 1.85; color: var(--ink-2); white-space: pre-line; }
.greeting-sign { padding: 8px 20px 24px; text-align: right; font-weight: 800; color: var(--ink); letter-spacing: -.4px; }

/* 인용 / 도장 느낌 */
.seal { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 10px;
  background: var(--accent); color: #fff; font-weight: 800; font-size: 13px; line-height: 1.1; text-align: center;
  box-shadow: var(--sh-1); transform: rotate(-4deg); }

/* ===== 탭바 ===== */
.tabbar {
  flex: 0 0 auto;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--border);
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 50;
}
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--ink-3); }
.tab__ico { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linejoin: round; stroke-linecap: round; }
.tab span { font-size: 10.5px; font-weight: 700; letter-spacing: -.3px; }
.tab.is-active { color: var(--brand); }
.tab.is-active .tab__ico { fill: var(--brand-soft); stroke: var(--brand); }
.tab:active { opacity: .6; }

/* ===== 바텀시트 ===== */
[hidden] { display: none !important; }
.sheet-scrim {
  position: absolute; inset: 0; z-index: 80;
  background: rgba(20,16,12,.42);
  display: flex; align-items: flex-end;
  animation: fade .2s ease;
}
.sheet {
  width: 100%; background: var(--surface);
  border-radius: 24px 24px 0 0; padding: 8px 0 calc(20px + env(safe-area-inset-bottom));
  box-shadow: var(--sh-3); animation: slideUp .32s var(--ease);
  max-height: 80%; overflow-y: auto;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: none; } }
.sheet__grip { width: 40px; height: 4px; border-radius: 99px; background: var(--border-2); margin: 8px auto 6px; }
.sheet__body { padding: 8px 18px 4px; }
.sheet__title { font-size: 18px; font-weight: 800; letter-spacing: -.5px; margin: 6px 0 4px; }
.sheet__desc { font-size: 13.5px; color: var(--ink-2); line-height: 1.6; margin: 0 0 18px; }
.sheet__actions { display: flex; flex-direction: column; gap: 9px; }

/* ===== 토스트 ===== */
.toast {
  position: absolute; left: 50%; bottom: calc(var(--tabbar-h) + 22px);
  translate: -50% 16px;
  background: #2A241E; color: #fff; padding: 11px 18px; border-radius: var(--r-pill);
  font-size: 13px; font-weight: 600; letter-spacing: -.3px; white-space: nowrap;
  box-shadow: var(--sh-3); z-index: 90; opacity: 0; pointer-events: none;
  transition: opacity .25s, translate .25s var(--ease);
}
.toast.is-show { opacity: 1; translate: -50% 0; }

/* ===== 푸터 ===== */
.foot { padding: 24px 20px 8px; text-align: center; }
.foot__line { font-size: 11.5px; color: var(--ink-3); line-height: 1.7; }
.foot__brand { font-weight: 800; color: var(--ink-2); margin-bottom: 6px; font-size: 13px; }

/* ===== 아트/사진 레이어 ===== */
.art-fill { position: absolute; inset: 0; width: 100%; height: 100%; }
.art-img { object-fit: cover; opacity: 0; transition: opacity .5s var(--ease); }
.art-img.is-on { opacity: 1; }
/* 과정 카드 사진 위 살짝 어둡게(상단 태그 가독성) */
.course-card__scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(28,18,8,.28), rgba(28,18,8,0) 55%); }
