/* mong.wypll.com — 잉크와 종이 */

@import url('https://fonts.googleapis.com/css2?family=Gowun+Batang:wght@400;700&display=swap');
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css');

:root {
  --paper: #f2ece1;
  --paper-deep: #e7ded0;
  --ink: #191512;
  --ink-soft: #4a4239;
  --ink-faint: #8b8175;
  --seal: #b8412c;
  --seal-soft: #d8836f;
  --rule: rgba(25, 21, 18, 0.14);

  --serif: 'Gowun Batang', 'Nanum Myeongjo', 'Apple SD Gothic Neo', serif;
  --sans: 'Pretendard Variable', Pretendard, 'Apple SD Gothic Neo', sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  letter-spacing: -0.01em;
  word-break: keep-all;
}

/* 종이 결. 배경 위에 얇게 깔아 단색 면을 없앤다. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
  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.85' numOctaves='3'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.35'/%3E%3C/svg%3E");
}

/* 왼쪽 여백의 세로 괘선 — 원고지의 흔적 */
body::after {
  content: '';
  position: fixed;
  top: 0;
  bottom: 0;
  left: max(2.5rem, calc(50% - 30rem));
  width: 1px;
  background: var(--rule);
  pointer-events: none;
  z-index: 0;
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 60rem;
  margin: 0 auto;
  padding: clamp(2.5rem, 7vw, 6rem) clamp(1.25rem, 5vw, 4rem) 5rem;
}

/* ── 머리글 ───────────────────────────── */

.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
  animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}

.mark {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--ink);
}

.mark em {
  font-style: normal;
  color: var(--seal);
}

.masthead nav {
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}

.masthead nav a {
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s, color 0.25s;
}

.masthead nav a:hover { color: var(--seal); border-bottom-color: var(--seal); }

/* ── 표제 ─────────────────────────────── */

.lede { margin: clamp(3rem, 9vw, 6rem) 0 0; }

.eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--seal);
  margin: 0 0 1.25rem;
  animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.3, 1) 0.08s both;
}

h1 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(2.5rem, 8vw, 4.75rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0;
  animation: rise 0.8s cubic-bezier(0.2, 0.7, 0.3, 1) 0.14s both;
}

h1 .seal {
  color: var(--seal);
  position: relative;
  display: inline-block;
}

/* 낙관 — 표제 뒤에 찍히는 붉은 도장 */
h1 .seal::after {
  content: '';
  position: absolute;
  right: -0.55em;
  top: 0.18em;
  width: 0.34em;
  height: 0.34em;
  background: var(--seal);
  border-radius: 2px;
  transform: rotate(-8deg) scale(0);
  animation: stamp 0.5s cubic-bezier(0.3, 1.5, 0.5, 1) 0.85s forwards;
}

.sub {
  max-width: 34rem;
  margin: 1.75rem 0 0;
  font-size: 1.0625rem;
  color: var(--ink-soft);
  animation: rise 0.8s cubic-bezier(0.2, 0.7, 0.3, 1) 0.22s both;
}

/* ── 버튼 ─────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 2.5rem;
  padding: 0.9rem 1.6rem;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.25s, transform 0.2s, box-shadow 0.25s;
  animation: rise 0.8s cubic-bezier(0.2, 0.7, 0.3, 1) 0.3s both;
}

.btn:hover {
  background: var(--seal);
  transform: translateY(-2px);
  box-shadow: 0 0.75rem 1.5rem -0.5rem rgba(184, 65, 44, 0.5);
}

.btn:active { transform: translateY(0); }

.btn:disabled {
  background: var(--ink-faint);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn .arrow { transition: transform 0.25s; }
.btn:hover .arrow { transform: translateX(3px); }

/* ── 목록 ─────────────────────────────── */

.notes {
  margin: clamp(4rem, 10vw, 7rem) 0 0;
  display: grid;
  gap: 1px;
  background: var(--rule);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.notes div {
  background: var(--paper);
  padding: 1.5rem 0.25rem;
  display: grid;
  grid-template-columns: 4rem 1fr;
  gap: 1.5rem;
  align-items: baseline;
}

.notes dt {
  font-family: var(--serif);
  font-size: 1.5rem;
  color: var(--seal-soft);
  margin: 0;
}

.notes dd { margin: 0; color: var(--ink-soft); font-size: 0.9375rem; }
.notes dd strong { display: block; color: var(--ink); font-weight: 600; }

/* ── 업로드 화면 ──────────────────────── */

.panel {
  margin-top: clamp(2.5rem, 7vw, 4rem);
  animation: rise 0.8s cubic-bezier(0.2, 0.7, 0.3, 1) 0.3s both;
}

.field { margin-bottom: 1.75rem; }

label {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.6rem;
}

input[type='password'] {
  width: 100%;
  max-width: 22rem;
  padding: 0.75rem 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 1.5px solid var(--rule);
  outline: none;
  transition: border-color 0.25s;
}

input[type='password']:focus { border-bottom-color: var(--seal); }
input[type='password']::placeholder { color: var(--ink-faint); opacity: 0.6; }

/* 드롭존 — 손으로 그린 듯한 점선 상자 */
.drop {
  position: relative;
  display: block;
  padding: clamp(2.5rem, 8vw, 4.5rem) 1.5rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.32);
  border: 1.5px dashed var(--rule);
  border-radius: 3px;
  cursor: pointer;
  transition: border-color 0.25s, background 0.25s, transform 0.25s;
}

.drop:hover { border-color: var(--seal-soft); background: rgba(255, 255, 255, 0.55); }

.drop.over {
  border-color: var(--seal);
  background: rgba(184, 65, 44, 0.06);
  transform: scale(1.008);
}

.drop .glyph {
  font-family: var(--serif);
  font-size: 2.5rem;
  line-height: 1;
  color: var(--seal);
  display: block;
  margin-bottom: 1rem;
}

.drop .main { display: block; font-size: 1.0625rem; font-weight: 600; }
.drop .hint { display: block; font-size: 0.8125rem; color: var(--ink-faint); margin-top: 0.35rem; }
.drop input { display: none; }

/* 고른 파일 목록 */
.picked { margin: 1.5rem 0 0; padding: 0; list-style: none; }

.picked li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.9375rem;
  animation: rise 0.4s ease both;
}

.picked .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picked .sz { color: var(--ink-faint); font-size: 0.8125rem; font-variant-numeric: tabular-nums; flex: none; }
.picked .over-limit { color: var(--seal); }

/* 진행 — 잉크가 번지듯 */
.bar {
  height: 2px;
  margin-top: 2rem;
  background: var(--paper-deep);
  overflow: hidden;
  display: none;
}

.bar.on { display: block; }

.bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--seal);
  transition: width 0.2s linear;
}

.msg {
  margin-top: 1.5rem;
  padding-left: 1rem;
  border-left: 2px solid var(--rule);
  font-size: 0.9375rem;
  color: var(--ink-soft);
  display: none;
}

.msg.on { display: block; animation: rise 0.4s ease both; }
.msg.ok { border-left-color: var(--seal); }
.msg.err { border-left-color: var(--seal); color: var(--seal); }
.msg ul { margin: 0.5rem 0 0; padding-left: 1.1rem; }
.msg li { font-size: 0.875rem; }

.foot {
  margin-top: clamp(4rem, 10vw, 7rem);
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.foot a { color: var(--ink-faint); text-decoration: none; }
.foot a:hover { color: var(--seal); }

@keyframes rise {
  from { opacity: 0; transform: translateY(0.9rem); }
  to { opacity: 1; transform: none; }
}

@keyframes stamp {
  to { transform: rotate(-8deg) scale(1); }
}

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

@media (max-width: 34rem) {
  body::after { display: none; }
  .notes div { grid-template-columns: 2.5rem 1fr; gap: 1rem; }
  .foot { flex-direction: column; gap: 0.35rem; }
}
