/* For Sofia — editorial, quiet.
   White #FFFFFF · ink #1A1A1A · muted #6E6A66 · hairline #E5E2DE
   One restrained accent, deep rose #A63D57, used only for the day count. */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  line-height: 1.75;
  color: #1A1A1A;
  background-color: #FFFFFF;
}
img { max-width: 100%; }
a { color: #A63D57; text-decoration: none; }
a:hover { text-decoration: underline; }

.serif {
  font-family: "Newsreader", Georgia, "Noto Serif SC", "Songti SC", "STSong", serif;
}

/* ---------- language switch: quiet text links, top right ---------- */
.langbar { border-bottom: 1px solid #E5E2DE; }
.langbar-inner {
  max-width: 640px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.langbar-mark {
  font-family: "Newsreader", Georgia, "Noto Serif SC", "Songti SC", serif;
  font-size: 15px;
  color: #1A1A1A;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lang-switch { display: flex; gap: 16px; flex: 0 0 auto; }
.lang-switch button {
  min-height: 44px;
  padding: 8px 2px;
  font-size: 14px;
  font-family: inherit;
  border: 0;
  background: none;
  color: #6E6A66;
  cursor: pointer;
}
.lang-switch button:hover { color: #1A1A1A; }
.lang-switch button.active {
  color: #1A1A1A;
  text-decoration: underline;
  text-underline-offset: 5px;
}

/* ---------- text nav between two hairlines, not sticky ---------- */
.sitenav { border-bottom: 1px solid #E5E2DE; }
.sitenav-inner {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.sitenav-inner::-webkit-scrollbar { display: none; }
.sitenav a {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 12px 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #6E6A66;
  text-decoration: none;
  white-space: nowrap;
}
.sitenav a:hover { color: #1A1A1A; text-decoration: none; }

section[id], header[id] { scroll-margin-top: 24px; }

/* ---------- layout ---------- */
.wrap, .admin { max-width: 640px; margin: 0 auto; padding: 0 20px 64px; }

/* Section label: small caps, letter-spaced, muted. */
.kicker {
  margin: 0 0 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: #6E6A66;
}
.rule { border: 0; border-top: 1px solid #E5E2DE; margin: 32px 0; }

/* ---------- hero ---------- */
.hero { text-align: center; padding: 56px 0 8px; }
.eyebrow {
  margin: 0 0 16px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: #6E6A66;
}
.hero h1 {
  font-family: "Newsreader", Georgia, "Noto Serif SC", "Songti SC", serif;
  font-size: 44px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin: 0 0 14px;
}
.hero .sub {
  font-family: "Newsreader", Georgia, "Noto Serif SC", "Songti SC", serif;
  font-size: 20px;
  line-height: 1.6;
  margin: 0;
}

/* ---------- day line ---------- */
.dayline {
  text-align: center;
  padding: 26px 0 8px;
  font-family: "Newsreader", Georgia, "Noto Serif SC", "Songti SC", serif;
  font-size: 19px;
  line-height: 1.6;
  color: #6E6A66;
}
.dayline .days-big { color: #A63D57; }

/* ---------- sections: air, not cards ---------- */
section.block { padding: 48px 0 8px; }
section.block + section.block { border-top: 1px solid #E5E2DE; }
section.block p { margin: 0 0 16px; }
section.block p:last-child { margin-bottom: 0; }
.sign { text-align: right; color: #6E6A66; margin: 20px 0 0; }

/* opening letter */
.opening .big {
  font-family: "Newsreader", Georgia, "Noto Serif SC", "Songti SC", serif;
  font-size: 22px;
  line-height: 1.55;
  margin: 20px 0;
}
.opening .lead {
  font-family: "Newsreader", Georgia, "Noto Serif SC", "Songti SC", serif;
  font-size: 19px;
  line-height: 1.6;
}
.opening p { font-size: 17px; }

/* chapters */
.chapter { margin: 0 0 40px; }
.chapter:last-child { margin-bottom: 0; }
.chapter-label {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: #6E6A66;
}
.chapter h3 {
  font-family: "Newsreader", Georgia, "Noto Serif SC", "Songti SC", serif;
  font-size: 28px;
  font-weight: 500;
  line-height: 1.3;
  margin: 0 0 6px;
}
.chapter time {
  display: block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .1em;
  color: #6E6A66;
  margin-bottom: 10px;
}
.chapter .body-text {
  font-family: "Newsreader", Georgia, "Noto Serif SC", "Songti SC", serif;
  font-size: 19px;
  line-height: 1.6;
  margin: 0 0 8px;
}
.chapter .note { font-size: 15px; color: #6E6A66; margin: 0 0 8px; }

/* chat bubbles: her words, in her own English,
   with a small translation underneath that follows the language switch. */
.chat { margin: 14px 0 6px; }
.bubble {
  display: inline-block;
  max-width: 88%;
  background: #F7F7F5;
  border: 1px solid #E5E2DE;
  border-radius: 12px 12px 12px 4px;
  padding: 12px 16px;
}
.bubble-main { margin: 0; font-size: 16.5px; line-height: 1.6; }
.bubble-sub { margin: 6px 0 0; font-size: 13.5px; line-height: 1.6; color: #6E6A66; }
.bubble-who { margin: 5px 0 0 4px; font-size: 12px; letter-spacing: .06em; color: #6E6A66; }

/* diary / wishes / album */
.empty { color: #6E6A66; margin: 0; }
.empty + .empty { margin-top: 2px; }
.diary-entry { border-top: 1px solid #EFEDEA; padding: 16px 0; }
.diary-entry:first-of-type { border-top: 0; padding-top: 2px; }
.diary-entry time { font-size: 13px; font-weight: 600; letter-spacing: .08em; color: #6E6A66; }
.diary-entry p { margin: 6px 0 0; white-space: pre-wrap; }
.wishes { list-style: none; margin: 0; padding: 0; }
.wishes li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 11px 0;
  border-top: 1px solid #EFEDEA;
}
.wishes li:first-child { border-top: 0; padding-top: 2px; }
.wishes .box {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin-top: 3px;
  border-radius: 50%;
  border: 1.5px solid #C9C4BD;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  color: #FFFFFF;
}
.wishes li.done { color: #6E6A66; text-decoration: line-through; }
.wishes li.done .box { background: #A63D57; border-color: #A63D57; text-decoration: none; }
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.gallery figure { margin: 0; }
.gallery img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; }
.gallery figcaption { font-size: 13px; color: #6E6A66; margin-top: 6px; }

/* ---------- sealed letter: a plain paper envelope, nothing else ---------- */
.envelope {
  position: relative;
  width: 260px;
  max-width: 100%;
  height: 168px;
  margin: 6px auto 22px;
  perspective: 700px;
  cursor: pointer;
}
.envelope:focus-visible { outline: 2px solid rgba(166, 61, 87, .4); outline-offset: 4px; }
.env-body {
  position: absolute;
  inset: 0;
  background: #FAF9F6;
  border: 1px solid #E5E2DE;
}
.env-flap {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 58%;
  background: #F0EEE9;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top center;
  transition: transform .6s ease;
}
.envelope.open .env-flap { transform: rotateX(180deg); }
.letter-tap { text-align: center; font-size: 13px; letter-spacing: .06em; color: #6E6A66; margin: 0 0 18px; }
.letter-pw-note { font-size: 14px; color: #6E6A66; }
.letter-intro { font-size: 16px; color: #6E6A66; }
.letter-paper {
  background: #FFFFFF;
  border: 1px solid #E5E2DE;
  padding: 26px 22px;
  margin-top: 20px;
}
.letter-version {
  font-family: "Newsreader", Georgia, "Noto Serif SC", "Songti SC", serif;
  font-size: 18px;
  line-height: 1.85;
  white-space: pre-wrap;
}
.letter-wrong {
  background: #FBF1F2;
  border: 1px solid #EFCED4;
  color: #8F3347;
  padding: 12px 16px;
}
.letter-form label { display: block; font-size: 15px; color: #6E6A66; margin-bottom: 2px; }
.letter-form input[type=password] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #E5E2DE;
  font-size: 17px;
  font-family: inherit;
  color: #1A1A1A;
  background: #FFFFFF;
  margin: 4px 0 14px;
}
.letter-form input:focus { outline: 2px solid rgba(166, 61, 87, .35); border-color: #A63D57; }
.letter-form button {
  min-height: 44px;
  background: #A63D57;
  color: #FFFFFF;
  border: 0;
  padding: 12px 22px;
  font-size: 16px;
  font-family: inherit;
  cursor: pointer;
}
.letter-form button:hover { background: #93344D; }

/* footer */
footer { border-top: 1px solid #E5E2DE; margin-top: 48px; padding-top: 20px; text-align: center; font-size: 13px; color: #6E6A66; }
footer p { margin: 4px 0; }

/* ---------- admin (same quiet language) ---------- */
/* Admin sections are separated by hairlines, not boxes. */
.admin .card { border-top: 1px solid #E5E2DE; padding: 28px 0; }
.admin .card:first-of-type { border-top: 0; }
.admin h1.page-title {
  font-family: "Newsreader", Georgia, "Noto Serif SC", "Songti SC", serif;
  font-size: 32px;
  font-weight: 500;
  margin: 44px 0 4px;
}
.admin .lede { color: #6E6A66; font-size: 15px; margin: 0 0 8px; }
.admin label { display: block; font-size: 15px; color: #6E6A66; margin-bottom: 2px; }
.admin input[type=text], .admin input[type=date], .admin input[type=password], .admin input[type=file], .admin textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #E5E2DE;
  font-size: 17px;
  font-family: inherit;
  color: #1A1A1A;
  background: #FFFFFF;
  margin: 4px 0 14px;
}
.admin input:focus, .admin textarea:focus { outline: 2px solid rgba(166, 61, 87, .35); border-color: #A63D57; }
.admin textarea { min-height: 110px; resize: vertical; }
.admin textarea.tall { min-height: 230px; }
.admin button {
  min-height: 44px;
  background: #A63D57;
  color: #FFFFFF;
  border: 0;
  padding: 12px 22px;
  font-size: 16px;
  font-family: inherit;
  cursor: pointer;
}
.admin button:hover { background: #93344D; }
.admin button.danger { background: #FFFFFF; color: #A63D57; border: 1px solid #E0C6CC; }
.admin button.danger:hover { background: #FBF1F2; }
.admin button.small { min-height: 36px; padding: 8px 14px; font-size: 14px; }
.admin .row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 14px 0;
  border-top: 1px solid #EFEDEA;
}
.admin .row:first-of-type { border-top: 0; }
.admin .msg, .admin .err { padding: 12px 16px; margin: 12px 0; }
.admin .msg { background: #F7F7F5; border: 1px solid #E5E2DE; }
.admin .err { background: #FBF1F2; border: 1px solid #EFCED4; color: #8F3347; }
.admin .thumb { width: 96px; }
.admin .muted { color: #6E6A66; font-size: 14px; }
.admin .row .actions { white-space: nowrap; }
.admin .row .actions form { display: inline; }

/* ---------- small screens ---------- */
@media (max-width: 480px) {
  .hero { padding-top: 44px; }
  .hero h1 { font-size: 36px; }
  .chapter h3 { font-size: 25px; }
  .opening .big { font-size: 20px; }
  .lang-switch { gap: 12px; }
  .lang-switch button { font-size: 13px; }
}
