/* ===== 글씨체 (public/fonts, OFL 라이선스) =====
   완성형 한글 2,350자 + 자주 쓰는 기호만 들어 있어요.
   없는 글자는 아래 --font-* 목록의 다음 글씨체(휴대폰 기본 글씨)로 자연스럽게 보여요. */
@font-face {
  font-family: "Dongle";
  src: url("./fonts/dongle-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: block; /* 제목은 기본 글씨와 모양이 많이 달라서, 잠깐 기다렸다가 바로 Dongle 로 */
}
@font-face {
  font-family: "Noto Sans KR";
  src: url("./fonts/noto-sans-kr-400-700.woff2") format("woff2");
  font-weight: 400 700; /* 굵기 400~700 이 한 파일에 */
  font-style: normal;
  font-display: swap;  /* 본문은 기본 글씨로 먼저 보이다가 바뀜 */
}

/* ===== 색·글씨 기본값 ===== */
:root {
  --cream: #FBF4EA;
  --ink: #2B2421;
  --ink-soft: #7a6d66;
  --juri: #D9823B;
  --tori: #978471;
  --line: #eadfce;
  --nav-h: 64px;
  --font-title: "Dongle", "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --font-body: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  word-break: keep-all;      /* 한글은 낱말 중간에서 줄이 바뀌지 않게 */
  overflow-wrap: anywhere;   /* 아주 긴 낱말(메일 주소 등)은 넘치지 않게 */
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* 아이폰 폭(390px 안팎)에 맞추고, 큰 화면에서는 가운데 정렬 */
.app {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding-top: env(safe-area-inset-top);
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
  background: var(--cream);
}

/* ===== 제목 ===== */
.top { padding: 14px 16px 0; text-align: center; }
.title {
  margin: 0;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 52px;
  line-height: 1;
  letter-spacing: 0.5px;
}

/* ===== 쭈리·토리 동그라미 ===== */
.profiles {
  display: flex;
  justify-content: center;
  gap: 40px;
  padding: 14px 16px 6px;
}
.profile { text-align: center; }
.avatar {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 4px solid var(--c);
  background: #fff8ee;
  display: grid;
  place-items: center;
}
.avatar--juri { --c: var(--juri); }
.avatar--tori { --c: var(--tori); }
.avatar__placeholder { font-size: 13px; color: var(--ink-soft); }
.avatar__add {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--cream);
  background: var(--c);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}
.profile__name { margin: 6px 0 0; font-size: 15px; font-weight: 700; }

/* ===== 탭 4개 ===== */
.tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 8px;
  border-bottom: 1px solid var(--line);
}
.tab {
  background: none;
  border: 0;
  padding: 8px 2px 9px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  color: var(--ink-soft);
  position: relative;
  cursor: pointer;
}
.tab svg {
  width: 24px; height: 24px;
  fill: none; stroke: var(--c); stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.tab.is-active { color: var(--ink); font-weight: 700; }
.tab.is-active::after {
  content: "";
  position: absolute;
  left: 18%; right: 18%; bottom: -1px;
  height: 3px;
  border-radius: 3px;
  background: var(--c);
}

/* ===== 틈 없는 3열 사진 칸 ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}
.tile {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.tile__label {
  position: absolute;
  left: 0; right: 0; bottom: 6px;
  text-align: center;
  font-size: 11px;
  color: rgba(43, 36, 33, 0.55);
}
/* 얼굴 뱃지 (왼쪽 위) */
.tile__faces { position: absolute; top: 6px; left: 6px; display: flex; }
.face {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--c);
  background: #fff;
  font-size: 11px; font-weight: 700;
  display: grid; place-items: center;
  color: var(--ink);
}
.face + .face { margin-left: -7px; }
.face--juri { --c: var(--juri); }
.face--tori { --c: var(--tori); }
/* 영상 ▶ (오른쪽 위) */
.tile__play {
  position: absolute; top: 6px; right: 6px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(43, 36, 33, 0.55);
  color: #fff; font-size: 10px;
  display: grid; place-items: center;
  padding-left: 2px;
}
/* 관리자만 보기 자물쇠 (오른쪽 아래) */
.tile__lock {
  position: absolute; right: 6px; bottom: 6px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(43, 36, 33, 0.55);
  display: grid; place-items: center;
}
.tile__lock svg {
  width: 13px; height: 13px;
  fill: none; stroke: #fff; stroke-width: 2.2;
  stroke-linecap: round; stroke-linejoin: round;
}

.sample-note {
  margin: 14px 16px;
  font-size: 12px;
  color: var(--ink-soft);
  text-align: center;
}
.empty {
  grid-column: 1 / -1;
  padding: 40px 16px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 14px;
}

/* ===== 꼬리말 (기록 화면 맨 아래, 아래 메뉴 바로 위) ===== */
.footer {
  margin-top: 8px;
  padding: 22px 16px 24px;
  background: #2B2421;
  color: #CDBFA8;
  text-align: center;
  font-size: 11px;
  line-height: 1.7;
}
.footer p { margin: 0; }
.footer a { color: #FBF4EA; text-decoration: none; }
.footer__links { font-size: 12px; margin-bottom: 8px !important; }
.footer__links a { padding: 4px 2px; }
.footer__bar { margin: 0 8px; color: #9C8A78; }
.footer__small { color: #9C8A78; margin-top: 4px !important; }
.footer__ddlab { color: #EFC48C; font-weight: 700; }

/* ===== 안내 화면 (일기 소개 · 사진 이용 안내 · 개인정보처리방침) ===== */
.page__top {
  position: relative;
  padding: 12px 56px 6px;
  text-align: center;
}
.page__back {
  position: absolute;
  left: 8px; top: 50%;
  transform: translateY(-50%);
  width: 44px; height: 44px;
  border: 0; background: none;
  display: grid; place-items: center;
  cursor: pointer;
}
.page__back svg {
  width: 26px; height: 26px;
  fill: none; stroke: var(--ink); stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.page__title {
  margin: 0;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 40px;
  line-height: 1.1;
}
.page__body {
  padding: 8px 24px 32px;
  font-size: 15px;
  line-height: 1.75;
}
.page__body p { margin: 0 0 14px; }
.page__body ul { margin: 0 0 14px; padding-left: 18px; }
.page__body li { margin-bottom: 8px; }
.page__body a { color: var(--juri); }
.page__sign { color: var(--ink-soft); margin-top: 24px !important; }

/* ===== 준비 중 화면 ===== */
.soon {
  min-height: 70vh;
  display: grid;
  place-content: center;
  text-align: center;
}
.soon h2 { margin: 0; font-family: var(--font-title); font-size: 48px; line-height: 1; }
.soon p { margin: 8px 0 0; color: var(--ink-soft); }

/* ===== 맨 아래 메뉴 ===== */
.bottom-nav {
  position: fixed;
  left: 50%; bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: rgba(251, 244, 234, 0.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 11px;
}
.bottom-nav svg {
  width: 24px; height: 24px;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.bottom-nav a.is-active { color: var(--ink); font-weight: 700; }
