:root {
  color-scheme: dark;
  --ground: #10141d;
  --panel: #191f2a;
  --line: #424654;
  --ink: #f4eee3;
  --muted: #c4c0bd;
  --accent: #e2bc80;
  --serif: 'Noto Serif KR', 'Nanum Myeongjo', Batang, Georgia, serif;
  font-family: 'Pretendard', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--ground); color: var(--ink); line-height: 1.65; word-break: keep-all; }
img { display: block; max-width: 100%; }
h1, h2, h3, p, dl, figure { margin: 0; }
a { color: inherit; text-underline-offset: .25em; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.wrap { width: min(100% - 2rem, 75rem); margin-inline: auto; }
.skip { position: absolute; top: .5rem; left: 1rem; padding: .5rem 1rem; background: var(--ground); z-index: 2; }
.skip:not(:focus) { transform: translateY(-130%); }
.top { display: flex; justify-content: space-between; align-items: center; gap: .75rem 1.5rem; flex-wrap: wrap; min-height: 4.75rem; padding-block: .8rem; }
.brand { color: var(--accent); font-family: var(--serif); font-size: 1.15rem; font-weight: 700; text-decoration: none; }
nav { display: flex; gap: .7rem 1.5rem; flex-wrap: wrap; }
nav a { text-decoration: none; color: var(--muted); font-size: .9rem; }
nav a:hover, .footer a:hover { color: var(--accent); }
.hero { position: relative; isolation: isolate; overflow: hidden; min-height: 32rem; display: grid; align-items: center; border: 1px solid var(--line); background: #212a38; }
.hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 66% 47%; z-index: -2; }
.hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg,#10141df5 0%,#10141ddc 29%,#10141d66 65%,#10141d12 100%); z-index: -1; }
.hero-copy { padding: clamp(1.5rem, 6vw, 5rem); }
.eyebrow { color: var(--accent); letter-spacing: .13em; font-size: .88rem; font-weight: 700; }
h1, h2 { font-family: var(--serif); line-height: 1.16; }
.hero h1 { font-size: clamp(3rem, 7vw, 5.8rem); margin-block: .75rem 1.15rem; }
.hero-copy > p:not(.eyebrow) { color: #e0ddd7; }
.primary { display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem; padding: .5rem 1rem; border: 1px solid var(--accent); background: var(--accent); color: #251b13; text-decoration: none; border-radius: 4px; font-weight: 700; }
.primary:hover { background: #f2d29d; }
.hero .primary, .archive-cover .primary { margin-top: 1.5rem; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem 1.25rem; margin-top: 1.5rem; }
.hero-actions .primary { margin-top: 0; }
.hero-link { color: var(--ink); font-weight: 650; }
.section { margin-block: clamp(3rem, 8vw, 6.5rem); scroll-margin-top: 1.5rem; }
.section-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: .6rem 1.5rem; margin-bottom: 1.25rem; }
.section-heading h2 { font-size: clamp(1.8rem, 4vw, 2.65rem); }
.section-heading p, .records p, .seal p, .classified p, .archive-cover > p:not(.eyebrow) { color: var(--muted); }
.filters { background: var(--panel); border: 1px solid var(--line); display: grid; grid-template-columns: minmax(12rem,1.7fr) repeat(3,minmax(8.25rem,1fr)) auto; gap: .85rem; align-items: end; padding: 1rem; }
.filters label { display: grid; gap: .35rem; min-width: 0; color: var(--muted); font-size: .9rem; }
.filters input, .filters select, .filters button { min-width: 0; min-height: 2.75rem; padding: .45rem .65rem; background: var(--ground); color: var(--ink); border: 1px solid #5b5863; border-radius: 4px; }
.filters select { appearance: none; padding-inline-end: 1.8rem; background: linear-gradient(45deg,transparent 50%,var(--accent) 51%) calc(100% - 15px) 50%/5px 5px no-repeat,linear-gradient(135deg,var(--accent) 50%,transparent 51%) calc(100% - 10px) 50%/5px 5px no-repeat,var(--ground); }
.filters button:hover { border-color: var(--accent); }
.count { color: var(--muted); min-height: 1.5em; margin-block: 1rem .7rem; font-size: .9rem; }
.cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill,minmax(min(100%, 16rem),1fr)); }
.monster { overflow: hidden; border: 1px solid var(--line); background: var(--panel); }
.monster img { width: 100%; aspect-ratio: 16/10; object-fit: cover; background: #242532; }
.image-zoom { display: block; width: 100%; position: relative; padding: 0; border: 0; background: none; cursor: zoom-in; }
.image-zoom::after { content: '+'; position: absolute; right: .55rem; bottom: .55rem; display: grid; place-items: center; width: 1.85rem; height: 1.85rem; border: 1px solid #ffffff54; border-radius: 50%; background: #10141de8; color: var(--ink); font-size: 1.15rem; line-height: 1; pointer-events: none; }
.image-zoom:hover::after, .image-zoom:focus-visible::after { border-color: var(--accent); color: var(--accent); }
.image-zoom:focus-visible { outline-offset: -3px; }
.image-viewer { max-width: calc(100% - 2rem); max-height: calc(100% - 2rem); padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); }
.image-viewer::backdrop { background: #090b12dc; }
.image-viewer-bar { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .5rem .75rem; }
.image-viewer h2 { font-family: inherit; font-size: 1rem; line-height: 1.3; }
.image-viewer button { padding: .35rem .7rem; border: 1px solid var(--line); border-radius: 4px; background: var(--ground); color: var(--ink); }
.image-viewer img { display: block; width: auto; height: auto; max-width: min(100%, 70rem, calc(100vw - 2rem - 2px)); max-height: calc(100dvh - 6rem); margin-inline: auto; object-fit: contain; }
html:has(.image-viewer[open]) { overflow: hidden; }
.monster-content { padding: .9rem 1rem 1rem; }
.monster-header { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem .65rem; justify-content: space-between; }
.monster h3 { font-size: 1.1rem; line-height: 1.45; }
.level { color: var(--accent); font-size: .92rem; font-weight: 750; white-space: nowrap; }
.monster dl { display: grid; grid-template-columns: auto 1fr; gap: .3rem .8rem; margin-top: .6rem; font-size: .9rem; }
.monster dt, .archive figcaption { color: var(--muted); }
.monster dd { margin: 0; overflow-wrap: anywhere; }
.empty { padding: 1.3rem; border: 1px solid var(--line); }
.records { display: grid; gap: 1rem; grid-template-columns: repeat(3, 1fr); }
.records article { padding: 1.2rem; border: 1px solid var(--line); background: var(--panel); }
.records h3, .seal h3 { margin-bottom: .35rem; }
.profile-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%, 16rem),1fr)); gap: 1rem; }
.court { grid-template-columns: repeat(auto-fit,minmax(min(100%, 24rem),1fr)); margin-top: 1rem; }
.profile { min-width: 0; overflow: hidden; border: 1px solid var(--line); background: var(--panel); }
.profile img { width: 100%; aspect-ratio: 16/10; object-fit: cover; object-position: center 37%; background: #242532; }
.court .profile { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
.court .profile img { height: 100%; aspect-ratio: auto; object-position: center 30%; }
.profile-copy { min-width: 0; padding: 1rem; }
.profile-meta { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .2rem .65rem; color: var(--accent); font-size: .82rem; font-weight: 650; }
.profile h3 { margin-block: .25rem; font-size: 1.2rem; }
.profile p { color: var(--muted); }
.profile .profile-kit { margin-bottom: .55rem; color: var(--ink); font-size: .86rem; }
.seal { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; margin-top: 1.25rem; padding: 1.25rem; border: 1px solid #887253; background: #25212a; }
#seal-button { padding: .55rem 1rem; border-radius: 4px; border: 1px dashed var(--accent); background: #16151b; color: var(--accent); font-family: monospace; letter-spacing: .17em; min-height: 2.75rem; }
#seal-button:hover { border-style: solid; }
.seal .seal-status { color: var(--accent); }
.footer { border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 1rem; padding-block: 1.5rem 2.5rem; color: var(--muted); font-size: .9rem; }
.sealed { --ground: #181419; --panel: #241d23; --line: #59484a; }
.archive { max-width: 55rem; margin-inline: auto; padding-bottom: 3rem; }
.archive-cover { padding: clamp(1.5rem, 7vw, 4.5rem); border: 1px solid #91715c; background: linear-gradient(130deg,#34232b,#1d171c); }
.archive-cover h2 { margin-block: .8rem 1rem; font-size: clamp(2.8rem, 6vw, 4.8rem); }
.classified { border-bottom: 1px solid var(--line); padding-block: 2rem; }
.classified h3 { font-family: var(--serif); line-height: 1.16; font-size: clamp(1.8rem, 4vw, 2.65rem); }
.classified p { margin-top: .8rem; }
.finale { display: grid; gap: 1.25rem; grid-template-columns: 1.25fr 1fr; align-items: center; }
.finale img { width: 100%; max-height: 24rem; object-fit: cover; border: 1px solid var(--line); }
.archive figcaption { margin-top: .4rem; font-size: .87rem; }
.archive-portraits { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; margin-top: 1.1rem; }
.archive-portraits img { width: 100%; aspect-ratio: 16/10; object-fit: cover; object-position: center 37%; border: 1px solid var(--line); }
.classified ol { padding-left: 1.5rem; margin: .85rem 0 0; color: var(--muted); }
.classified li + li { margin-top: .35rem; }
.return { margin-top: 1.5rem; color: var(--accent); }
@media (max-width: 52rem) {
  .filters { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .filters label:first-child { grid-column: 1/-1; }
  .records { grid-template-columns: 1fr; }
}
@media (max-width: 34rem) {
  .wrap { width: calc(100% - 1.4rem); }
  .hero { min-height: 27rem; align-items: end; }
  .hero::after { background: linear-gradient(0deg,#10141df5 0%,#10141ddc 31%,#10141d53 76%,#10141d14 100%); }
  .finale { grid-template-columns: 1fr; }
  .court .profile { display: block; }
  .court .profile img { height: auto; aspect-ratio: 16/10; }
}
