@font-face {
  font-family: Archive Myeongjo;
  src: url("assets/ui/title.woff") format("woff");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --ink: #f3efe8;
  --muted: #c3c3c8;
  --accent: #db808c;
  --edge: clamp(1rem, 4.5vw, 5.25rem);
  --bar: 4.25rem;
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans CJK KR", sans-serif;
  color: var(--ink);
  background: #0a0d13;
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; }
button { font: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid #fff0f1; outline-offset: 4px; }

.home { min-height: 100svh; isolation: isolate; }
.scenery, .rain { pointer-events: none; position: fixed; inset: 0; }
.scenery {
  z-index: -2;
  background: radial-gradient(ellipse at 93% 12%, #241b26 0%, transparent 50%), #0b1119;
}
.scenery::before {
  content: "";
  position: absolute;
  inset: 0 13% 0 0;
  background-image:
    linear-gradient(180deg, rgba(5, 8, 15, .40), transparent 38%, rgba(3, 7, 13, .32)),
    linear-gradient(90deg, rgba(3, 4, 9, .22), rgba(6, 10, 16, .11)),
    url("assets/ui/night-road.webp");
  background-size: cover;
  background-position: 40% 55%;
  mask-image: linear-gradient(90deg, #000 0%, #000 42%, transparent 100%);
}
.scenery::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(4,7,11,.63), transparent 23%, transparent 78%, rgba(4,7,11,.35));
}
.rain { width: 100%; height: 100%; z-index: -1; }

.masthead {
  height: var(--bar);
  border-bottom: 1px solid rgba(226,228,241,.13);
  background: linear-gradient(180deg, rgba(8,11,18,.70), rgba(8,11,18,.18));
}
.masthead-inner, .landing { width: min(100%, 104rem); margin-inline: auto; padding-inline: var(--edge); }
.masthead-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; }
.wordmark, .back { display: inline-flex; align-items: center; gap: .78rem; }
.wordmark {
  font: 400 1.125rem/1.35 "Archive Myeongjo", "Batang", serif;
  letter-spacing: .08em;
  color: #e0dfe3;
}
.archive-mark {
  display: inline-block;
  flex: none;
  width: 1.45rem;
  height: 1.55rem;
  background: linear-gradient(121deg, transparent 23%, #e5e0df 24% 31%, transparent 32% 43%, #f3eeec 44% 52%, transparent 53% 66%, #ce7587 67% 74%, transparent 75%);
  clip-path: polygon(0 38%, 75% 0, 100% 14%, 100% 63%, 24% 100%, 0 84%);
}
.rain-switch {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: .4rem 0 .4rem .55rem;
  gap: .55rem;
  border: none;
  background: none;
  cursor: pointer;
  color: #e3e2e6;
  font-size: .875rem;
}
.rain-mark { display: flex; align-items: center; gap: 3px; transform: skewX(-22deg); }
.rain-mark i { width: 1px; height: .48rem; background: #cdcfd6; }
.rain-mark i:nth-child(2) { height: .82rem; }
.switch-track { display: inline-flex; align-items: center; width: 1.62rem; height: .9rem; padding: 2px; border: 1px solid #777981; border-radius: 1rem; }
.switch-track::after { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: #aaaab1; }
.rain-switch[aria-pressed="true"] .switch-track { background: #5b343e; border-color: #bc7686; }
.rain-switch[aria-pressed="true"] .switch-track::after { margin-left: auto; background: #ffdae0; }

.landing {
  min-height: calc(100svh - var(--bar));
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, clamp(27rem, calc(100svh - 10.5rem), min(55vw, 49rem)));
  gap: clamp(2rem, 4vw, 5rem);
  align-items: center;
  padding-block: 1.5rem;
}
.introduction { align-self: stretch; display: flex; flex-direction: column; justify-content: center; padding: 0 0 11vh 1vw; }
.introduction h1 {
  margin: 0;
  font: 400 clamp(5.1rem, min(7.65vw, 13svh), 8rem)/1.12 "Archive Myeongjo", "Batang", "Songti SC", serif;
  letter-spacing: -.065em;
  text-shadow: 0 2px 26px #0b101aa0;
}
.introduction h1 span { display: block; }
.title-rule {
  width: clamp(6rem, 12vw, 12rem);
  height: 1px;
  margin-top: 1.8rem;
  background: linear-gradient(90deg, #d88895, #ae59698a 64%, transparent);
  position: relative;
}
.title-rule::before { position: absolute; content: ""; width: 5px; height: 5px; background: #e297a4; top: -2px; left: 0; transform: rotate(45deg); }
.collection { min-width: 0; }
.banners { list-style: none; margin: 0; padding: 0; display: grid; gap: .68rem; }
.banner {
  display: block;
  position: relative;
  overflow: hidden;
  background: #11151c;
  box-shadow: 0 .35rem 1.6rem #0005;
  text-decoration: none;
}
.banner::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(236,226,236,.24);
  pointer-events: none;
  transition: border-color .2s;
}
.banner picture, .banner img { display: block; width: 100%; height: auto; }
@media (hover: hover) {
  .banner:hover::after { border-color: #f0bbc4; }
  .banner:hover { box-shadow: 0 .35rem 1.5rem #0008, 0 0 1rem #bf758020; }
}
.guidance {
  margin: .95rem 0 0;
  text-align: center;
  font-size: .94rem;
  line-height: 1.6;
  letter-spacing: -.025em;
  color: var(--muted);
  word-break: keep-all;
  text-wrap: balance;
}
.reader { min-height: 100svh; background: #080a0e; }
.reader-bar {
  position: sticky; top: 0; z-index: 2; background: #0c1017;
  border-bottom: 1px solid #292c35;
}
.reader-nav {
  max-width: 62rem; margin: auto; display: grid; align-items: center;
  grid-template-columns: 1fr auto 1fr; padding: 0 1.2rem; min-height: 3.4rem; gap: .5rem;
}
.reader-nav h1 { margin: 0; font-size: 1rem; font-weight: 600; letter-spacing: -.035em; }
.back { justify-self: start; min-height: 44px; text-decoration: none; gap: .45rem; color: #dddbe0; font-size: .875rem; }
.back .archive-mark { width: .95rem; height: 1rem; }
.position { justify-self: end; font: 400 .875rem/1.4 ui-monospace, monospace; color: #a6a8b2; }
.position b { color: #f2eded; font-weight: 500; }
.strip { max-width: 900px; width: 100%; margin: 0 auto; padding: 0; background: #000; line-height: 0; }
.strip img { width: 100%; height: auto; display: block; margin: 0; padding: 0; border: 0; }
.reader-end { display: grid; justify-items: center; gap: 1.6rem; padding: 3rem 1rem 4.25rem; }
.end-mark { width: 5.5rem; height: 1px; background: linear-gradient(90deg, transparent, #b57280, transparent); }
.reader-end a { font-size: .95rem; text-decoration: none; padding: .9rem 1.6rem; border: 1px solid #50505a; }
.reader-end a:hover, .back:hover { color: #ffced9; }

@media (max-width: 759px) {
  :root { --bar: 3.45rem; --edge: clamp(.875rem, 4vw, 2rem); }
  .masthead-inner { max-width: 40rem; }
  .wordmark { font-size: 1rem; }
  .archive-mark { width: 1.18rem; height: 1.3rem; }
  .scenery::before { inset: 0; background-position: 43% 40%; mask-image: linear-gradient(180deg,#000, #0009 76%, #0004); }
  .landing { display: block; max-width: 40rem; min-height: auto; padding-block: clamp(1.4rem, 5svh, 3.4rem) 2.2rem; }
  .introduction { padding: 0 0 clamp(1.15rem, 3.3svh, 2.3rem); flex-direction: row; align-items: center; justify-content: start; gap: 1.25rem; }
  .introduction h1 { font-size: clamp(2.35rem, 8.5vw, 3.8rem); line-height: 1.25; white-space: nowrap; }
  .introduction h1 span { display: inline; }
  .title-rule { width: clamp(2.3rem, 12vw, 5rem); margin: .4rem 0 0; }
  .banners { gap: .65rem; }
  .guidance { margin: 1.05rem auto 0; max-width: 28em; font-size: .9375rem; }
  .reader-nav { min-height: 3rem; padding-inline: .75rem; }
  .reader-nav h1 { font-size: .94rem; }
}
@media (max-height: 520px) and (min-width: 760px) {
  :root { --bar: 3.1rem; }
  .landing { padding-block: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
