/* 기본.css — 화면 전부가 쓰는 하나의 뼈대 (2026-08-26)
 *
 * 전에는 화면마다 <style> 을 따로 갖고 있었다. 같은 단추가 화면마다 조금씩 달랐고,
 * 한 곳을 고쳐도 나머지가 따라오지 않았다. **여기 한 곳에서만 정한다.**
 *
 * 바깥에서 아무것도 불러오지 않는다 — 글꼴도 CDN 도 없다.
 * 이 사이트는 Access 안쪽이고, 바깥으로 나가는 요청은 새는 구멍이 된다.
 */

/* ── 값 ──────────────────────────────────────────────── */
:root {
  color-scheme: light dark;

  /* 종이와 먹. 그림책을 다루는 자리라 흰색보다 따뜻하게 둔다. */
  --바탕: #faf8f4;
  --판: #ffffff;
  --판2: #f4f1ea;
  --먹: #221f1a;
  --흐린먹: #6d675c;
  --더흐린: #97918a;
  --선: #e2ddd2;
  --진한선: #cdc6b8;

  --점: #2f6f62;          /* 포인트. 짙은 청록 — 종이 위에서 튀지 않는다 */
  --점연함: #eaf2ef;
  --빨강: #a4302a;
  --빨강연함: #fbeceb;

  --둥금: 10px;
  --둥금작게: 7px;
  --그림자: 0 1px 2px rgba(34, 31, 26, .05), 0 4px 14px rgba(34, 31, 26, .05);
  --그림자진하게: 0 2px 6px rgba(34, 31, 26, .08), 0 12px 32px rgba(34, 31, 26, .09);

  --글꼴: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕",
          system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --글꼴고정: "D2Coding", "Consolas", "SFMono-Regular", ui-monospace, monospace;

  --너비: 62rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --바탕: #16171a;
    --판: #1d1f23;
    --판2: #24272c;
    --먹: #e9e5de;
    --흐린먹: #a8a29a;
    --더흐린: #7c766e;
    --선: #2e3137;
    --진한선: #3d4148;
    --점: #6fb3a2;
    --점연함: #1c2b28;
    --빨강: #e79b95;
    --빨강연함: #2c1f1e;
    --그림자: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .28);
    --그림자진하게: 0 2px 6px rgba(0, 0, 0, .36), 0 12px 32px rgba(0, 0, 0, .4);
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--바탕);
  color: var(--먹);
  font-family: var(--글꼴);
  font-size: 15px;
  line-height: 1.75;
  letter-spacing: -.003em;           /* 한글은 아주 살짝 좁혀야 덜 성기다 */
  word-break: keep-all;              /* 낱말 가운데서 끊지 않는다 */
  overflow-wrap: anywhere;
}

/* 눈으로만 숨긴다. 화면 낭독기는 읽는다. */
.읽어주기 {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

/* 건너뛰기 — 탭으로 들어온 사람이 머리띠를 지나칠 수 있게 */
.건너뛰기 {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--판); color: var(--먹);
  padding: .7rem 1.1rem; border: 1px solid var(--진한선);
  border-radius: 0 0 var(--둥금) 0;
}
.건너뛰기:focus { left: 0; }

/* ── 머리띠 ──────────────────────────────────────────── */
.머리띠 {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--바탕) 86%, transparent);
  backdrop-filter: saturate(1.6) blur(10px);
  border-bottom: 1px solid var(--선);
}
.머리띠 > .속 {
  max-width: var(--너비); margin: 0 auto;
  padding: .7rem 1.25rem;
  display: flex; align-items: center; gap: 1rem;
}
.표찰 {
  display: flex; align-items: baseline; gap: .55rem;
  text-decoration: none; color: inherit; font-weight: 700;
  letter-spacing: -.01em; white-space: nowrap;
}
.표찰 .작게 { font-weight: 500; font-size: .8rem; color: var(--흐린먹); }
.머리띠 .틈 { flex: 1; }
.머리띠 .누구 {
  font-size: .82rem; color: var(--흐린먹);
  display: flex; align-items: center; gap: .45rem; white-space: nowrap;
}
.머리띠 .누구 b { color: var(--먹); font-weight: 600; }

/* ── 판 ──────────────────────────────────────────────── */
.가운데 {
  max-width: var(--너비); margin: 0 auto; padding: 2.4rem 1.25rem 5rem;
}
.좁게 { max-width: 25rem; margin: 0 auto; padding: 3.5rem 1.25rem 5rem; }

h1, h2, h3 { letter-spacing: -.02em; line-height: 1.45; margin: 0; }
h1 { font-size: 1.45rem; font-weight: 700; }
h2 { font-size: 1.05rem; font-weight: 650; }
h3 { font-size: .9rem; font-weight: 650; }
.머리글 { margin-bottom: 1.9rem; }
.머리글 h1 { margin-bottom: .3rem; }
.곁 { color: var(--흐린먹); font-size: .88rem; margin: 0; }

a { color: var(--점); text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--점); outline-offset: 2px; border-radius: 3px;
}

/* ── 카드 ────────────────────────────────────────────── */
.카드 {
  background: var(--판); border: 1px solid var(--선);
  border-radius: var(--둥금); box-shadow: var(--그림자);
}
.카드.속 { padding: 1.4rem 1.5rem; }

/* 고르는 카드 (갈림길) */
.고름판 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 36rem) { .고름판 { grid-template-columns: 1fr; } }

.갈래 {
  display: block; padding: 1.7rem 1.5rem 1.6rem;
  background: var(--판); border: 1px solid var(--선);
  border-radius: var(--둥금); box-shadow: var(--그림자);
  text-decoration: none; color: inherit;
  transition: transform .13s ease, box-shadow .13s ease, border-color .13s ease;
}
a.갈래:hover {
  transform: translateY(-2px);
  box-shadow: var(--그림자진하게); border-color: var(--진한선);
}
a.갈래:active { transform: translateY(0); }
.갈래 .이름 { display: block; font-size: 1.2rem; font-weight: 700; letter-spacing: -.02em; }
.갈래 .풀이 { display: block; font-size: .87rem; color: var(--흐린먹); margin-top: .15rem; }
.갈래.잠김 { opacity: .55; box-shadow: none; background: var(--판2); }

.딱지 {
  display: inline-block; margin-top: .8rem;
  padding: .1rem .5rem; border-radius: 999px;
  border: 1px solid var(--진한선); background: var(--판);
  font-size: .73rem; color: var(--흐린먹); letter-spacing: 0;
}
.딱지.점 { background: var(--점연함); border-color: transparent; color: var(--점); }

/* ── 입력 ────────────────────────────────────────────── */
.칸 { margin-top: 1.05rem; }
label { display: block; font-size: .84rem; font-weight: 600; margin-bottom: .3rem; }
.돕는말 { font-size: .78rem; color: var(--더흐린); margin: .3rem 0 0; }

input[type="text"], input[type="password"], input[type="email"], select, textarea {
  width: 100%; padding: .65rem .8rem;
  font: inherit; font-size: .95rem;
  color: var(--먹); background: var(--판);
  border: 1px solid var(--진한선); border-radius: var(--둥금작게);
  transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--점);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--점) 16%, transparent);
  outline: none;
}
input[aria-invalid="true"] { border-color: var(--빨강); }

.비번칸 { position: relative; }
.비번칸 input { padding-right: 3.6rem; }
.보기단추 {
  position: absolute; right: .35rem; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; color: var(--흐린먹);
  font: inherit; font-size: .8rem; padding: .35rem .5rem;
  border-radius: var(--둥금작게); cursor: pointer;
}
.보기단추:hover { background: var(--판2); color: var(--먹); }

/* ── 단추 ────────────────────────────────────────────── */
.단추 {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .62rem 1.05rem; font: inherit; font-size: .9rem; font-weight: 600;
  color: var(--먹); background: var(--판);
  border: 1px solid var(--진한선); border-radius: var(--둥금작게);
  cursor: pointer; text-decoration: none;
  transition: background .12s, border-color .12s, transform .06s;
}
.단추:hover:not(:disabled) { background: var(--판2); }
.단추:active:not(:disabled) { transform: translateY(1px); }
.단추:disabled { opacity: .5; cursor: default; }

.단추.주 { background: var(--점); border-color: var(--점); color: #fff; }
.단추.주:hover:not(:disabled) { filter: brightness(1.08); background: var(--점); }
@media (prefers-color-scheme: dark) { .단추.주 { color: #10201c; } }

.단추.넓게 { width: 100%; }
.단추.작게 { padding: .4rem .7rem; font-size: .83rem; }
.단추.민 { border-color: transparent; background: transparent; color: var(--흐린먹); }
.단추.민:hover:not(:disabled) { background: var(--판2); color: var(--먹); }

/* ── 알림 ────────────────────────────────────────────── */
.말 { margin: .9rem 0 0; font-size: .86rem; min-height: 1.3em; color: var(--흐린먹); }
.말.틀림 { color: var(--빨강); font-weight: 500; }
.말:empty { min-height: 0; margin: 0; }

.알림 {
  padding: .85rem 1rem; border-radius: var(--둥금작게);
  background: var(--판2); border: 1px solid var(--선);
  font-size: .85rem; color: var(--흐린먹);
}
.알림.점 { background: var(--점연함); border-color: transparent; color: var(--점); }
.알림.빨강 { background: var(--빨강연함); border-color: transparent; color: var(--빨강); }

.빈칸 {
  padding: 2.6rem 1rem; text-align: center;
  color: var(--더흐린); font-size: .88rem;
}

/* 기다림 점 셋 */
.기다림::after {
  content: "···"; display: inline-block;
  animation: 점깜빡 1.2s steps(4) infinite; width: 1.2em;
  text-align: left; overflow: hidden; vertical-align: bottom;
}
@keyframes 점깜빡 { 0% { width: 0 } 100% { width: 1.2em } }

/* ── 목록 ────────────────────────────────────────────── */
.목록 { display: flex; flex-direction: column; gap: .55rem; }
.목록칸 {
  display: flex; align-items: center; gap: .9rem;
  padding: .85rem 1.05rem;
  background: var(--판); border: 1px solid var(--선);
  border-radius: var(--둥금); text-align: left; width: 100%;
  font: inherit; color: inherit; cursor: pointer;
  transition: border-color .12s, background .12s;
}
.목록칸:hover { border-color: var(--진한선); background: var(--판2); }
.목록칸[aria-current="true"] {
  border-color: var(--점); background: var(--점연함);
}
.목록칸 .속 { flex: 1; min-width: 0; }
.목록칸 .이름 { font-weight: 600; display: block; }
.목록칸 .잔 { font-size: .8rem; color: var(--흐린먹); display: block; }

/* ── 표 ──────────────────────────────────────────────── */
.글판 {
  white-space: pre-wrap; font-size: .89rem; line-height: 1.85;
  max-height: 24rem; overflow: auto;
  padding: .1rem .2rem 0;
}
.글판::-webkit-scrollbar { width: 10px; }
.글판::-webkit-scrollbar-thumb { background: var(--선); border-radius: 99px; }

@media (max-width: 40rem) {
  body { font-size: 15px; }
  .가운데 { padding: 1.6rem 1rem 4rem; }
  .좁게 { padding: 2.2rem 1rem 4rem; }
  .머리띠 > .속 { padding: .6rem 1rem; }
  .머리띠 .누구 .긴것 { display: none; }
  h1 { font-size: 1.28rem; }
}

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