/* ==========================================================================
   StudyMadang — 따뜻한 종이 기록장
   Palette: warm ivory paper · deep pine ink · persimmon accent
   Type:    Hahmlet (display serif) · IBM Plex Sans KR (body)
   ========================================================================== */

:root {
  --paper: #f6f1e7;
  --paper-deep: #ede5d3;
  --card: #fffdf8;
  --ink: #262219;
  --ink-soft: #6f6555;
  --ink-faint: #9a8f7c;
  --pine: #1f4d3a;
  --pine-soft: #3a7359;
  --pine-wash: rgba(31, 77, 58, 0.08);
  --persimmon: #d16a2e;
  --persimmon-deep: #b6521a;
  --line: rgba(38, 34, 25, 0.16);
  --line-soft: rgba(38, 34, 25, 0.09);
  --shadow: 0 1px 2px rgba(38, 34, 25, 0.05), 0 8px 28px rgba(38, 34, 25, 0.08);
  --shadow-lift: 0 2px 4px rgba(38, 34, 25, 0.06), 0 16px 44px rgba(38, 34, 25, 0.13);
  --serif: "Hahmlet", "Noto Serif KR", serif;
  --sans: "IBM Plex Sans KR", "Apple SD Gothic Neo", sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.7;
  word-break: keep-all;
  overflow-wrap: break-word;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* 종이 질감 + 은은한 비네트 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(255, 252, 243, 0.9) 0%, transparent 55%),
    radial-gradient(100% 70% at 85% 100%, rgba(31, 77, 58, 0.05) 0%, transparent 60%);
}

::selection { background: var(--pine); color: var(--paper); }

a { color: var(--pine); }

/* ── 상단 바 ─────────────────────────────────────────────── */
.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px clamp(20px, 5vw, 48px);
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}
.wordmark-seal {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--pine);
  color: var(--paper);
  transform: rotate(-4deg);
  transition: transform 0.35s var(--ease-out);
}
.wordmark-seal svg {
  width: 22px;
  height: 22px;
  display: block;
}
.wordmark:hover .wordmark-seal { transform: rotate(4deg) scale(1.05); }
.wordmark-text {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.02em;
}
.wordmark-text em { font-style: normal; color: var(--pine); }
.topbar-right {
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.topbar-right a {
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
  letter-spacing: 0.06em;
  transition: color 0.2s, border-color 0.2s;
}
.topbar-right a:hover { color: var(--pine); border-color: var(--pine); }

/* ── 공통 뷰 ─────────────────────────────────────────────── */
#app {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
}
.view {
  animation: view-in 0.6s var(--ease-out) both;
}
@keyframes view-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
.reveal { animation: view-in 0.7s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 90ms); }

/* ── 랜딩 (코드 입력) ────────────────────────────────────── */
.landing {
  max-width: 860px;
  margin: 0 auto;
  padding: clamp(28px, 7vh, 80px) 24px 60px;
  text-align: center;
  position: relative;
}

.stamp {
  position: absolute;
  top: -6px;
  right: clamp(-30px, 2vw, 40px);
  width: clamp(120px, 16vw, 180px);
  color: var(--pine);
  opacity: 0.4;
  transform: rotate(8deg);
  pointer-events: none;
}
.stamp svg { width: 100%; height: auto; display: block; animation: stamp-spin 70s linear infinite; }
@keyframes stamp-spin { to { transform: rotate(360deg); } }
.stamp .stamp-core-text {
  font-family: var(--serif);
  font-weight: 700;
  fill: currentColor;
}
.stamp .stamp-ring-text {
  font-family: var(--sans);
  font-weight: 600;
  letter-spacing: 2px;
  fill: currentColor;
}

.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--persimmon-deep);
  margin-bottom: 22px;
}
.eyebrow::before, .eyebrow::after {
  content: "";
  display: inline-block;
  width: 26px;
  height: 1px;
  background: currentColor;
  vertical-align: middle;
  margin: 0 12px;
  opacity: 0.55;
}

.landing h1 {
  font-family: var(--serif);
  font-weight: 800;
  font-size: clamp(44px, 9vw, 84px);
  line-height: 1.16;
  letter-spacing: -0.015em;
}
.landing h1 .accent {
  position: relative;
  color: var(--pine);
  white-space: nowrap;
}
.landing h1 .accent svg {
  position: absolute;
  left: -2%;
  bottom: -0.12em;
  width: 104%;
  height: 0.32em;
  color: var(--persimmon);
  overflow: visible;
}
.landing h1 .accent svg path {
  fill: none;
  stroke: currentColor;
  stroke-width: 7;
  stroke-linecap: round;
  stroke-dasharray: 320;
  stroke-dashoffset: 320;
  animation: draw-under 0.9s var(--ease-out) 0.55s forwards;
}
@keyframes draw-under { to { stroke-dashoffset: 0; } }

.lede {
  margin: 26px auto 0;
  max-width: 400px;
  color: var(--ink-soft);
  font-size: 16px;
}

/* 코드 입력 — 기록장 밑줄에 쓰는 느낌 */
.code-form { margin-top: clamp(36px, 6vh, 56px); }
.code-cells {
  display: inline-flex;
  gap: clamp(6px, 1.8vw, 15px);
}
.code-cell {
  width: clamp(42px, 12vw, 64px);
  height: clamp(56px, 15vw, 80px);
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(26px, 7vw, 42px);
  text-align: center;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-bottom: 3px solid var(--ink);
  border-radius: 10px 10px 3px 3px;
  box-shadow: var(--shadow);
  caret-color: var(--pine);
  outline: none;
  transition: transform 0.25s var(--ease-out), border-color 0.2s, box-shadow 0.25s;
}
.code-cell:focus {
  border-bottom-color: var(--pine);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
}
.code-cell.filled { border-bottom-color: var(--pine); }

.code-form.is-error .code-cell {
  border-bottom-color: var(--persimmon-deep);
  animation: shake 0.4s var(--ease-out);
}
@keyframes shake {
  20% { transform: translateX(-7px); }
  45% { transform: translateX(6px); }
  70% { transform: translateX(-4px); }
  90% { transform: translateX(2px); }
}

.code-hint {
  margin-top: 20px;
  font-size: 13.5px;
  color: var(--ink-faint);
  min-height: 22px;
  transition: color 0.2s;
}
.code-hint.is-error { color: var(--persimmon-deep); font-weight: 500; }
.code-hint.is-loading { color: var(--pine); }
.code-hint.is-loading::after {
  content: "…";
  display: inline-block;
  animation: dots 1.2s steps(4) infinite;
  width: 1.2em;
  text-align: left;
}
@keyframes dots { 0% { clip-path: inset(0 100% 0 0); } 100% { clip-path: inset(0 -0.2em 0 0); } }

.resume-chip {
  margin-top: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.25s var(--ease-out);
}
.resume-chip:hover {
  border-color: var(--pine);
  color: var(--pine);
  background: var(--pine-wash);
  transform: translateY(-1px);
}
.resume-chip .arr { transition: transform 0.25s var(--ease-out); }
.resume-chip:hover .arr { transform: translateX(3px); }

/* 랜딩 하단 안내 카드 */
.landing-notes {
  margin: clamp(56px, 10vh, 90px) auto 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  max-width: 720px;
  text-align: left;
}
.note-card {
  padding: 18px 20px;
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.note-card .num {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 13px;
  color: var(--persimmon-deep);
  letter-spacing: 0.08em;
}
.note-card h3 { font-size: 14.5px; font-weight: 600; margin: 6px 0 4px; }
.note-card p { font-size: 13px; color: var(--ink-soft); line-height: 1.6; }

/* ── 학생 목록 뷰 ───────────────────────────────────────── */
.student {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(16px, 4vh, 44px) 24px 72px;
}

.student-head { padding-bottom: 28px; }
.student-head .eyebrow { text-align: left; margin-bottom: 14px; }
.student-head .eyebrow::before, .student-head .eyebrow::after { display: none; }
.student-head h1 {
  font-family: var(--serif);
  font-weight: 800;
  font-size: clamp(34px, 7vw, 52px);
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.student-head h1 em { font-style: normal; color: var(--pine); }
.student-meta {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: 13.5px;
  color: var(--ink-soft);
}
.student-meta span::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--persimmon);
  vertical-align: middle;
  margin-right: 8px;
}

/* 탭 */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 26px;
}
.tab {
  appearance: none;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(16px, 3.6vw, 19px);
  color: var(--ink-faint);
  padding: 12px 18px 14px;
  position: relative;
  transition: color 0.25s;
}
.tab:hover { color: var(--ink-soft); }
.tab .count {
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 600;
  vertical-align: super;
  margin-left: 4px;
  color: var(--persimmon-deep);
}
.tab::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: -1px;
  height: 3px;
  border-radius: 2px 2px 0 0;
  background: var(--pine);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease-out);
}
.tab.active { color: var(--ink); }
.tab.active::after { transform: scaleX(1); }

/* 기록 카드 */
.doc-list { list-style: none; display: grid; gap: 14px; }
.doc-card a {
  display: flex;
  align-items: center;
  gap: clamp(14px, 3.5vw, 24px);
  padding: clamp(16px, 3.5vw, 22px) clamp(16px, 4vw, 26px);
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out), border-color 0.3s;
}
.doc-card a:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
  border-color: rgba(31, 77, 58, 0.3);
}

.date-block {
  flex: 0 0 auto;
  width: clamp(62px, 14vw, 74px);
  text-align: center;
  padding: 9px 4px 10px;
  border: 1.5px solid var(--pine);
  border-radius: 10px;
  color: var(--pine);
  background: var(--pine-wash);
  line-height: 1.25;
}
.date-block .dk {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  opacity: 0.8;
}
.date-block .dn {
  display: block;
  font-family: var(--serif);
  font-weight: 800;
  font-size: 27px;
  margin: 1px 0;
  white-space: nowrap;
}
.date-block .dn i {
  font-style: normal;
  font-family: var(--sans);
  font-size: 0.42em;
  font-weight: 700;
  margin-left: 1.5px;
  vertical-align: 0.12em;
  letter-spacing: 0;
}
.date-block .dr {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  opacity: 0.8;
}
.doc-card.is-monthly .date-block {
  border-color: var(--persimmon-deep);
  color: var(--persimmon-deep);
  background: rgba(209, 106, 46, 0.07);
}

.doc-main { flex: 1; min-width: 0; }
.doc-main h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(15.5px, 3.8vw, 18px);
  line-height: 1.45;
  letter-spacing: -0.005em;
}
.doc-main .doc-sub {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--ink-faint);
}
.doc-card .go {
  flex: 0 0 auto;
  font-size: 18px;
  color: var(--ink-faint);
  transform: translateX(-4px);
  opacity: 0.6;
  transition: transform 0.3s var(--ease-out), color 0.3s, opacity 0.3s;
}
.doc-card a:hover .go { transform: translateX(2px); color: var(--pine); opacity: 1; }

.latest-flag {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--paper);
  background: var(--persimmon);
  border-radius: 999px;
  padding: 2px 9px 3px;
  margin-left: 8px;
  vertical-align: 2px;
}

.empty-state {
  text-align: center;
  padding: 64px 20px;
  color: var(--ink-faint);
  border: 1.5px dashed var(--line);
  border-radius: 16px;
}
.empty-state .glyph { font-size: 30px; display: block; margin-bottom: 10px; }

/* ── 관리자 전체 학생 대시보드 ──────────────────────────── */
.admin {
  max-width: 900px;
  margin: 0 auto;
  padding: clamp(16px, 4vh, 44px) 24px 72px;
}
.admin-group {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(16px, 3.6vw, 20px);
  color: var(--ink);
  margin: 34px 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.admin-group::before {
  content: "";
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  background: var(--persimmon);
  border-radius: 2px;
  transform: rotate(45deg);
}
.admin-group::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line-soft);
}
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  gap: 14px;
}
.admin-card {
  display: flex;
  flex-direction: column;
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out), border-color 0.3s;
}
.admin-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
  border-color: rgba(31, 77, 58, 0.3);
}
.admin-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.admin-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--pine);
  color: var(--paper);
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 19px;
}
.admin-code {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}
.admin-name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.01em;
}
.admin-counts {
  display: flex;
  gap: 7px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.admin-counts .cnt {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 11px 4px;
  border-radius: 999px;
}
.admin-counts .cnt-w { background: var(--pine-wash); color: var(--pine); }
.admin-counts .cnt-m { background: rgba(209, 106, 46, 0.09); color: var(--persimmon-deep); }
.admin-empty {
  margin-top: 11px;
  font-size: 11.5px;
  color: var(--ink-faint);
}

/* ── 문서(리포트) 뷰 ────────────────────────────────────── */
.doc {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(10px, 3vh, 36px) 24px 80px;
}

.doc-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 26px;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  padding: 8px 14px 8px 10px;
  border-radius: 999px;
  transition: all 0.25s var(--ease-out);
}
.back-link:hover { background: var(--pine-wash); color: var(--pine); }
.back-link .arr { transition: transform 0.25s var(--ease-out); }
.back-link:hover .arr { transform: translateX(-3px); }

.doc-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 4px 12px 5px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  background: var(--card);
}
.chip.chip-type { border-color: var(--pine); color: var(--pine); background: var(--pine-wash); }
.doc.is-monthly .chip.chip-type { border-color: var(--persimmon-deep); color: var(--persimmon-deep); background: rgba(209, 106, 46, 0.07); }

/* 리포트 본문 — 종이 카드 */
.paper-sheet {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: clamp(28px, 6vw, 56px);
  position: relative;
  overflow: hidden;
}
.paper-sheet::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--pine) 0 62%, var(--persimmon) 62% 100%);
}

.doc-byline {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 12.5px;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
  padding-bottom: 18px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
}
.doc-byline .who { font-weight: 600; color: var(--ink-soft); }

/* ── 마크다운 타이포그래피 ─────────────────────────────── */
.md { font-size: 15.5px; }

.md h1 {
  font-family: var(--serif);
  font-weight: 800;
  font-size: clamp(25px, 5.6vw, 34px);
  line-height: 1.35;
  letter-spacing: -0.01em;
  margin: 22px 0 10px;
}
.md h2 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(19px, 4.4vw, 23px);
  line-height: 1.4;
  margin: 44px 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  gap: 10px;
}
.md h2::before {
  content: "";
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  background: var(--pine);
  border-radius: 3px;
  transform: rotate(45deg);
}
.md h3 {
  font-weight: 700;
  font-size: 16.5px;
  margin: 30px 0 8px;
  color: var(--pine);
}
.md h4 { font-weight: 600; font-size: 15px; margin: 22px 0 6px; }

.md p { margin: 12px 0; }
.md strong { font-weight: 700; color: var(--ink); background: linear-gradient(transparent 62%, rgba(209, 106, 46, 0.22) 62%); }
.md em { font-style: normal; color: var(--persimmon-deep); }
.md del { color: var(--ink-faint); }
.md a { color: var(--pine); text-underline-offset: 3px; }

.md ul, .md ol { margin: 12px 0 12px 4px; padding-left: 22px; }
.md li { margin: 7px 0; }
.md li::marker { color: var(--persimmon-deep); font-weight: 600; }
.md ul ul, .md ol ol, .md ul ol, .md ol ul { margin: 6px 0 6px 2px; }

/* 체크리스트 */
.md li.task { list-style: none; position: relative; padding-left: 6px; }
.md li.task .box {
  display: inline-grid;
  place-items: center;
  width: 19px;
  height: 19px;
  margin-right: 9px;
  margin-left: -26px;
  border: 1.5px solid var(--ink-faint);
  border-radius: 5px;
  vertical-align: -4px;
  font-size: 12px;
  line-height: 1;
  color: transparent;
  background: var(--card);
}
.md li.task.done .box {
  border-color: var(--pine);
  background: var(--pine);
  color: var(--paper);
}
.md li.task.done { color: var(--ink-soft); }

/* 인용 = 코치의 말 */
.md blockquote {
  margin: 20px 0;
  padding: 18px 22px 18px 26px;
  background: var(--pine-wash);
  border-left: 4px solid var(--pine);
  border-radius: 6px 14px 14px 6px;
  position: relative;
}
.md blockquote::before {
  content: "“";
  position: absolute;
  top: -4px;
  right: 14px;
  font-family: var(--serif);
  font-size: 54px;
  line-height: 1;
  color: var(--pine);
  opacity: 0.18;
}
.md blockquote p { margin: 6px 0; }
.md blockquote p:first-child { margin-top: 0; }
.md blockquote p:last-child { margin-bottom: 0; }

/* 표 */
.table-wrap { overflow-x: auto; margin: 18px 0; border-radius: 12px; border: 1px solid var(--line-soft); }
.md table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 400px; }
.md thead th {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 13.5px;
  text-align: left;
  color: var(--pine);
  background: var(--pine-wash);
  padding: 11px 16px;
  border-bottom: 1.5px solid rgba(31, 77, 58, 0.25);
  white-space: nowrap;
}
.md tbody td { padding: 11px 16px; border-bottom: 1px solid var(--line-soft); }
.md tbody tr:last-child td { border-bottom: none; }
.md tbody tr:nth-child(even) { background: rgba(238, 229, 211, 0.35); }

.md code {
  font-family: "SF Mono", ui-monospace, monospace;
  font-size: 0.88em;
  background: var(--paper-deep);
  border-radius: 5px;
  padding: 2px 7px;
}
.md pre {
  background: var(--paper-deep);
  border-radius: 12px;
  padding: 16px 20px;
  overflow-x: auto;
  margin: 16px 0;
}
.md pre code { background: none; padding: 0; }

.md hr {
  border: none;
  margin: 36px 0;
  text-align: center;
}
.md hr::after {
  content: "· · ·";
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: 0.6em;
  color: var(--ink-faint);
}

/* 이전/다음 기록 내비게이션 */
.doc-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 22px;
}
.doc-nav a {
  display: block;
  padding: 15px 18px;
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s;
  min-width: 0;
}
.doc-nav a:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.doc-nav .dir { font-size: 11.5px; font-weight: 600; letter-spacing: 0.08em; color: var(--ink-faint); display: block; margin-bottom: 3px; }
.doc-nav .ttl {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 13.5px;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.doc-nav a.next { text-align: right; }
.doc-nav .spacer { visibility: hidden; }

/* ── 상태 화면 (로딩 / 오류) ────────────────────────────── */
.status-view {
  max-width: 560px;
  margin: 0 auto;
  padding: 12vh 24px;
  text-align: center;
  color: var(--ink-soft);
}
.status-view .glyph { font-size: 36px; display: block; margin-bottom: 14px; }
.status-view h2 { font-family: var(--serif); font-size: 24px; margin-bottom: 8px; color: var(--ink); }
.status-view .btn-home {
  display: inline-block;
  margin-top: 22px;
  padding: 10px 22px;
  border-radius: 999px;
  background: var(--pine);
  color: var(--paper);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s;
}
.status-view .btn-home:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }

/* ── 푸터 ───────────────────────────────────────────────── */
.foot {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 30px 24px 40px;
  font-size: 12.5px;
  color: var(--ink-faint);
}
.foot strong { font-family: var(--serif); color: var(--ink-soft); letter-spacing: 0.02em; }
.foot-sub { margin-top: 3px; }

/* ── 반응형 ─────────────────────────────────────────────── */
@media (max-width: 640px) {
  .landing-notes { grid-template-columns: 1fr; }
  .stamp { display: none; }
  .doc-topline { flex-wrap: wrap; }
  .doc-nav { grid-template-columns: 1fr; }
  .doc-nav a.next { text-align: left; }
}

/* ── 인쇄 ───────────────────────────────────────────────── */
@media print {
  body::before, body::after, .topbar, .foot, .doc-topline, .doc-nav, .stamp { display: none !important; }
  body { background: #fff; }
  .paper-sheet { border: none; box-shadow: none; padding: 0; }
  .paper-sheet::before { display: none; }
}

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