/* tzyping.com — 파란 볼펜 한 자루로 쓴 기록장 */

:root {
  --paper: #fbfcfe;
  --ink: #1f3796;      /* 볼펜 잉크 */
  --ink-soft: #55629f; /* 날짜, 보조 글 */
  --rule: #d5dbef;
  --wash: #eef1fa;

  --serif: "Hahmlet", "Apple SD Gothic Neo", serif;
  --sans: "IBM Plex Sans KR", "Apple SD Gothic Neo", sans-serif;

  --measure: 38rem;
  --wide: 56rem;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  font-size: 106.25%; /* 17px */
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.7;
  word-break: keep-all;
  overflow-wrap: break-word;
}

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

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 2px;
}

img { display: block; max-width: 100%; height: auto; }

.wrap {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* 머리 */
.site-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.wordmark {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.25rem;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.site-nav { display: flex; gap: 1.5rem; font-size: 0.95rem; }
.site-nav a { text-decoration: none; }
.site-nav a[aria-current="page"],
.site-nav a:hover { text-decoration: underline; }

/* 첫 문장 */
.hero {
  padding: 4.5rem 0 5.5rem;
}

.typed {
  margin: 0;
  max-width: 17em;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.9rem, 5.2vw, 3.4rem);
  line-height: 1.38;
  letter-spacing: -0.02em;
  white-space: pre-line;
  min-height: calc(1.38em * 3);
}

.caret {
  display: inline-block;
  width: 0.06em;
  height: 0.95em;
  margin-left: 0.04em;
  vertical-align: -0.1em;
  background: var(--ink);
  animation: blink 1s steps(1) 4;
  animation-fill-mode: forwards;
}

.caret.done { animation: blink 1s steps(1) 3 forwards, fade 0.6s ease 3s forwards; }

@keyframes blink { 50% { opacity: 0; } }
@keyframes fade { to { opacity: 0; } }

/* 기록 목록 */
.log { padding-bottom: 5rem; }

.log-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  margin-bottom: 1.5rem;
}

.log-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.35rem;
}

.filters { display: flex; gap: 0.35rem; }

.filters button {
  font: inherit;
  font-size: 0.9rem;
  color: var(--ink);
  background: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.15rem 0.8rem;
  cursor: pointer;
}

.filters button:hover { border-color: var(--rule); }
.filters button[aria-pressed="true"] { border-color: var(--ink); }

.month {
  margin: 2.5rem 0 0.5rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.entries { list-style: none; margin: 0; padding: 0; }

.entry {
  display: grid;
  grid-template-columns: 4.5rem 2.5rem minmax(0, 1fr);
  column-gap: 1rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--rule);
}

.entry-date,
.entry-kind {
  font-size: 0.9rem;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  padding-top: 0.35rem;
}

.entry-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.3rem;
  line-height: 1.5;
}

.entry-title a { text-decoration: none; }
.entry-title a:hover { text-decoration: underline; }

.entry-summary {
  margin: 0.25rem 0 0;
  max-width: var(--measure);
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.entry-photo { margin: 0.75rem 0 0; }
.entry-photo img { background: var(--wash); max-height: 26rem; width: auto; }
.entry-photo figcaption {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.empty {
  padding: 2rem 0;
  border-top: 1px solid var(--rule);
  color: var(--ink-soft);
}

/* 글 한 편 */
.essay { max-width: var(--measure); padding: 3rem 0 6rem; }

.essay-meta { font-size: 0.9rem; color: var(--ink-soft); margin: 0 0 1rem; }

.essay h1,
.page h1 {
  margin: 0 0 2.5rem;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.8rem, 4.5vw, 2.4rem);
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.prose {
  font-family: var(--serif);
  font-size: 1.12rem;
  line-height: 1.95;
}

.prose p { margin: 0 0 1.4em; }
.prose h2 { font-size: 1.3rem; font-weight: 600; margin: 2.4em 0 0.8em; }
.prose blockquote {
  margin: 1.8em 0;
  padding-left: 1.2rem;
  border-left: 2px solid var(--ink);
}

.essay-foot {
  margin-top: 3.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-size: 0.95rem;
}

/* 지금 */
.page { max-width: var(--measure); padding: 3rem 0 6rem; }

.page section { margin-top: 2.75rem; }

.page h2 {
  margin: 0 0 0.75rem;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.25rem;
}

.page ul { margin: 0; padding-left: 1.1rem; }
.page li { margin-bottom: 0.5rem; }
.page li::marker { color: var(--ink-soft); }

.updated { font-size: 0.9rem; color: var(--ink-soft); margin: -1.5rem 0 0; }

/* 바닥 */
.site-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  padding-top: 1.5rem;
  padding-bottom: 3rem;
  border-top: 1px solid var(--rule);
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.site-foot nav { display: flex; gap: 1.5rem; }

@media (max-width: 560px) {
  .wrap { padding: 0 1.15rem; }
  .site-head { padding-top: 1.25rem; padding-bottom: 1.25rem; }
  .site-nav { gap: 1rem; }
  .hero { padding: 2.5rem 0 3.5rem; }
  .entry { grid-template-columns: 3.4rem minmax(0, 1fr); }
  .entry-kind { display: none; }
  .entry-title { font-size: 1.15rem; }
}

@media (prefers-reduced-motion: reduce) {
  .caret { display: none; }
}
