:root {
  color-scheme: light;
  --paper: #f3efe6;
  --paper-deep: #e7e0d2;
  --ink: #1c1712;
  --ink-soft: #4e463d;
  --rule: #d5cec2;
  --cinnabar: #9d2c22;
  --cinnabar-deep: #6f1e18;
  --seal: #9d2c22;
  --serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", "PMingLiU", "Songti TC", Palatino, "Palatino Linotype", "Iowan Old Style", "Noto Serif CJK SC", "WenQuanYi Micro Hei", "Droid Sans Fallback", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Source Han Sans SC", "Microsoft YaHei", "Noto Sans CJK SC", "WenQuanYi Micro Hei", "Droid Sans Fallback", "Helvetica Neue", sans-serif;
}

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

html {
  background: var(--paper);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0) 14rem),
    var(--paper);
  font-family: var(--sans);
  font-size: 1.02rem;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
}

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

a {
  color: inherit;
}

button,
input {
  font: inherit;
  color: inherit;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: white;
  padding: 0.35rem 0.6rem;
  z-index: 3;
}

.skip:focus {
  top: 0.75rem;
}

.spine {
  display: none;
}

.wrap {
  width: min(980px, calc(100% - 2.4rem));
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 1.2rem 0 2rem;
}

.running {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--ink);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  color: var(--ink-soft);
}

.nameplate {
  text-align: center;
  padding-bottom: 0.4rem;
}

.eyebrow {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  color: var(--ink-soft);
}

.brand-en {
  margin-top: 1.35rem;
  text-transform: uppercase;
}

.masthead {
  margin: 0.25rem 0 0.45rem;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.9rem, 9vw, 5.5rem);
  line-height: 1.02;
  letter-spacing: 0.02em;
}

.subtitle {
  margin: 0;
  letter-spacing: 0.34em;
  font-size: 0.92rem;
}

.seal-row {
  margin: 0.9rem 0 0;
}

.seal {
  display: inline-grid;
  place-items: center;
  width: 2.15rem;
  height: 2.15rem;
  background: var(--seal);
  color: #f6efe6;
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1;
  transform: rotate(-8deg);
}

main {
  flex: 1;
}

.cover {
  display: grid;
  grid-template-columns: minmax(8.5rem, 13rem) minmax(0, 1fr);
  gap: 2rem 2.6rem;
  margin: 2.2rem 0 2.8rem;
  padding: 1.6rem 0 1.8rem;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

.cover-day {
  margin: 0.15rem 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(4.4rem, 12vw, 6.6rem);
  line-height: 0.82;
  letter-spacing: -0.04em;
}

.cover-month,
.issue-week,
.quiet,
.item-year,
.item-blurb,
.viewer-note {
  color: var(--ink-soft);
}

.cover-month,
.cover-blurb,
.issue-week {
  margin: 0;
}

.cover-title,
.issue-title,
.empty h2,
.issue-date {
  font-family: var(--serif);
  font-weight: 500;
}

.cover-title,
.issue-title,
.item-title,
.lede,
.cover-blurb {
  overflow-wrap: anywhere;
}

.cover-title {
  margin: 0 0 0.75rem;
  font-size: clamp(1.85rem, 4vw, 2.8rem);
  line-height: 1.28;
  letter-spacing: 0.02em;
}

.cover-blurb,
.lede {
  max-width: 38rem;
  font-size: 1.05rem;
}

.cover-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.6rem;
  margin: 1.35rem 0 0;
}

.text-link {
  color: var(--cinnabar-deep);
  text-decoration: none;
  border-bottom: 1px solid var(--cinnabar);
  letter-spacing: 0.08em;
  padding-bottom: 0.08rem;
}

.quiet-link {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-top: 0.4rem;
}

.section-head h2,
.archive-meta {
  margin: 0;
}

.section-head h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.55rem;
  letter-spacing: 0.08em;
}

.archive-meta,
.quiet,
.viewer-note,
.footer {
  font-size: 0.88rem;
}

.search {
  margin: 1.1rem 0 0.4rem;
}

.search label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--ink-soft);
  font-size: 0.86rem;
  letter-spacing: 0.08em;
}

.search-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem 1.2rem;
}

.search input {
  flex: 1 1 16rem;
  min-width: min(100%, 16rem);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  padding: 0.45rem 0;
}

.search button {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--cinnabar);
  color: var(--cinnabar-deep);
  padding: 0.45rem 0;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.form-error {
  margin: 0.55rem 0 0;
  color: var(--cinnabar-deep);
}

.archive-list {
  list-style: none;
  margin: 1.2rem 0 0;
  padding: 0;
}

.archive-list a {
  display: grid;
  grid-template-columns: 7.4rem minmax(0, 1fr);
  gap: 0.35rem 1.3rem;
  padding: 1.05rem 0;
  border-top: 1px solid var(--rule);
  text-decoration: none;
  align-items: baseline;
}

.archive-list li:last-child a {
  border-bottom: 1px solid var(--rule);
}

.archive-list time {
  display: flex;
  flex-direction: column;
  line-height: 1.35;
}

.item-day {
  font-family: var(--serif);
  font-size: 1.35rem;
  letter-spacing: 0.04em;
}

.item-year,
.item-blurb {
  font-size: 0.86rem;
}

.item-title {
  display: block;
  font-family: var(--serif);
  font-size: 1.28rem;
  line-height: 1.4;
}

.item-blurb {
  display: block;
  margin-top: 0.2rem;
}

.archive-list a:hover .item-title,
.neighbors a:hover,
.back a:hover {
  color: var(--cinnabar-deep);
}

.empty {
  margin-top: 1.5rem;
  padding: 2.4rem 0 1rem;
  border-top: 1px solid var(--ink);
}

.empty h2 {
  margin: 0.35rem 0 0.7rem;
  font-size: clamp(2rem, 5vw, 3.1rem);
  line-height: 1.2;
  letter-spacing: 0.04em;
}

.empty p,
.back {
  margin: 0;
}

.issue {
  padding-top: 1.8rem;
}

.back {
  margin-bottom: 1.4rem;
}

.back a {
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  letter-spacing: 0.06em;
}

.issue-date {
  margin: 0.35rem 0 0.2rem;
  font-size: clamp(2rem, 5vw, 3.3rem);
  line-height: 1.15;
  letter-spacing: 0.04em;
}

.issue-title {
  margin: 1rem 0 0.6rem;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  line-height: 1.35;
}

.viewer {
  margin-top: 1.6rem;
  background: white;
  border: 1px solid var(--rule);
}

.viewer iframe {
  display: block;
  width: 100%;
  height: 78vh;
  min-height: 28rem;
  border: 0;
  background: white;
}

.viewer-note {
  margin: 0.7rem 0 0;
}

.neighbors {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}

.neighbors a {
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
}

.neighbors a:last-child {
  text-align: right;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 3rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--rule);
  color: var(--ink-soft);
}

.footer p {
  margin: 0;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--cinnabar);
  outline-offset: 3px;
}

@media (min-width: 720px) {
  .masthead {
    font-size: clamp(3.4rem, 8vw, 5.5rem);
    letter-spacing: 0.12em;
  }
}

@media (min-width: 1180px) {
  .spine {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    inset: 0 auto 0 0;
    width: 2.8rem;
    margin: 0;
    writing-mode: vertical-rl;
    letter-spacing: 0.55em;
    font-size: 0.75rem;
    color: var(--ink-soft);
    border-right: 1px solid var(--rule);
  }
}

@media (max-width: 720px) {
  .wrap {
    width: min(100% - 1.6rem, 980px);
  }

  .subtitle {
    letter-spacing: 0.16em;
  }

  .cover,
  .archive-list a,
  .section-head,
  .neighbors {
    grid-template-columns: 1fr;
    display: grid;
  }

  .section-head,
  .neighbors,
  .footer,
  .running {
    display: flex;
  }

  .cover {
    gap: 1.1rem;
  }

  .archive-list a {
    gap: 0.35rem;
  }

  .neighbors {
    flex-direction: column;
  }

  .neighbors a:last-child {
    text-align: left;
  }

  .viewer iframe {
    height: 70vh;
    min-height: 22rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .seal {
    transform: none;
  }
}
