:root {
  --paper: #f5efe3;
  --paper-2: #ece3d1;
  --ink: #1d1b18;
  --ink-2: #4a4640;
  --ink-3: #7d766b;
  --line: #d9cfbb;
  --seal: #a8322a;
  --seal-dark: #842720;
  --white: #fffdf8;
  --radius: 4px;
  --shadow: 0 10px 30px rgba(40, 30, 15, .12);
  --serif: 'Nanum Myeongjo', serif;
  --sans: 'Noto Sans KR', system-ui, sans-serif;
  --brush: 'Nanum Brush Script', cursive;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.7;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .container { padding: 0 32px; } }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(245, 239, 227, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: baseline; gap: 10px; }
.logo-hanja { font-family: 'Ma Shan Zheng', var(--serif); font-size: 30px; line-height: 1; color: var(--ink); }
.logo-ko { font-family: var(--serif); font-weight: 700; font-size: 15px; letter-spacing: .08em; color: var(--ink-2); }
.nav { display: flex; gap: 32px; }
.nav a { font-size: 15px; font-weight: 500; color: var(--ink-2); position: relative; padding: 4px 0; }
.nav a::after { content: ''; position: absolute; left: 0; bottom: -2px; width: 0; height: 2px; background: var(--seal); transition: width .25s; }
.nav a:hover { color: var(--ink); }
.nav a:hover::after { width: 100%; }
.menu-toggle { display: none; width: 44px; height: 44px; position: relative; }
.menu-toggle span { position: absolute; left: 11px; width: 22px; height: 2px; background: var(--ink); transition: .25s; }
.menu-toggle span:nth-child(1) { top: 15px; }
.menu-toggle span:nth-child(2) { top: 21px; }
.menu-toggle span:nth-child(3) { top: 27px; }
.menu-toggle[aria-expanded="true"] span:nth-child(1) { top: 21px; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { top: 21px; transform: rotate(-45deg); }

@media (max-width: 860px) {
  .menu-toggle { display: block; }
  .nav {
    position: fixed; top: 64px; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    max-height: 0; overflow: hidden; transition: max-height .3s ease;
  }
  .nav.open { max-height: 400px; box-shadow: var(--shadow); }
  .nav a { padding: 16px; border-top: 1px solid var(--line); font-size: 16px; }
  .nav a::after { display: none; }
}

/* Hero */
.hero { padding: 56px 0 72px; position: relative; overflow: hidden; }
.hero-inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.eyebrow { font-size: 12px; letter-spacing: .25em; color: var(--seal); font-weight: 500; margin-bottom: 16px; }
.hero h1 { font-family: var(--serif); font-weight: 800; font-size: clamp(40px, 6vw, 72px); line-height: 1.15; letter-spacing: -.02em; margin-bottom: 20px; }
.lead { font-size: clamp(15px, 1.6vw, 18px); color: var(--ink-2); margin-bottom: 32px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 40px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 26px; border-radius: var(--radius); font-weight: 500; font-size: 15px; transition: .2s; }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--seal); }
.btn-ghost { border: 1px solid var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }
.stats { list-style: none; display: flex; gap: 36px; border-top: 1px solid var(--line); padding-top: 24px; }
.stats strong { display: block; font-family: var(--serif); font-size: 28px; font-weight: 800; line-height: 1.2; }
.stats span { font-size: 13px; color: var(--ink-3); }
.hero-art { aspect-ratio: 3 / 4; max-width: 440px; width: 100%; justify-self: center; box-shadow: var(--shadow); border: 10px solid var(--white); outline: 1px solid var(--line); }
.hero-art svg { width: 100%; height: 100%; }

@media (max-width: 860px) {
  .hero { padding: 32px 0 56px; }
  .hero-inner { grid-template-columns: 1fr; gap: 36px; }
  .hero-art { max-width: 320px; order: -1; }
  .stats { gap: 24px; }
}

/* Sections */
.section { padding: 88px 0; }
.section-alt { background: var(--paper-2); }
.section-head { text-align: center; margin-bottom: 44px; }
.section-hanja { display: block; font-family: 'Ma Shan Zheng', serif; font-size: 22px; color: var(--seal); letter-spacing: .2em; margin-bottom: 4px; }
.section-head h2 { font-family: var(--serif); font-weight: 800; font-size: clamp(28px, 4vw, 40px); line-height: 1.3; }
.section-head p { color: var(--ink-3); margin-top: 8px; }
@media (max-width: 640px) { .section { padding: 64px 0; } .section-head { margin-bottom: 32px; } }

/* Filters */
.filters { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 36px; }
.filter-group { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.chip { min-height: 40px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--white); font-size: 14px; color: var(--ink-2); transition: .2s; }
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip-sub { min-height: 34px; font-size: 13px; padding: 0 14px; }
.chip-sub.active { background: var(--seal); border-color: var(--seal); }

/* Works grid */
.works-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 32px 24px; }
@media (max-width: 560px) { .works-grid { grid-template-columns: repeat(2, 1fr); gap: 20px 12px; } }
.work-card { text-align: left; display: flex; flex-direction: column; animation: fadeUp .5s both; }
.work-frame { background: var(--white); padding: 10px; border: 1px solid var(--line); transition: transform .3s, box-shadow .3s; position: relative; }
.work-card:hover .work-frame, .work-card:focus-visible .work-frame { transform: translateY(-4px); box-shadow: var(--shadow); }
.work-frame svg { width: 100%; height: auto; aspect-ratio: 3 / 4; }
.work-frame .badge-new { position: absolute; top: 16px; left: 16px; background: var(--seal); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 2px; letter-spacing: .05em; }
.work-meta { padding-top: 14px; }
.work-meta h3 { font-family: var(--serif); font-size: 18px; font-weight: 700; line-height: 1.4; }
.work-meta .by { font-size: 14px; color: var(--ink-2); }
.work-meta .sub { font-size: 12px; color: var(--ink-3); }
@media (max-width: 560px) {
  .work-frame { padding: 6px; }
  .work-meta h3 { font-size: 15px; }
  .work-meta .by { font-size: 13px; }
}
.empty { text-align: center; color: var(--ink-3); padding: 40px 0; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* Artists */
.artists-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }
@media (max-width: 400px) { .artists-grid { grid-template-columns: 1fr; } }
.artist-card { background: var(--white); border: 1px solid var(--line); padding: 28px; display: flex; gap: 20px; align-items: flex-start; }
.artist-seal { flex: 0 0 72px; height: 72px; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; font-family: 'Ma Shan Zheng', serif; font-size: 34px; }
.artist-card h3 { font-family: var(--serif); font-size: 20px; font-weight: 800; }
.artist-card h3 small { font-family: 'Ma Shan Zheng', serif; font-weight: 400; font-size: 16px; color: var(--ink-3); margin-left: 6px; }
.artist-tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 10px; }
.tag { font-size: 12px; padding: 1px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); }
.tag-age { background: var(--seal); color: #fff; border-color: var(--seal); }
.artist-card p { font-size: 14px; color: var(--ink-2); }
.artist-link { display: inline-block; margin-top: 12px; font-size: 13px; font-weight: 500; color: var(--seal); }
.artist-link:hover { text-decoration: underline; }
@media (max-width: 480px) { .artist-card { padding: 20px; flex-direction: column; } }

/* Exhibitions */
.exhibitions { display: grid; gap: 0; border-top: 2px solid var(--ink); }
.exhibition { display: grid; grid-template-columns: 120px 1fr auto; gap: 24px; align-items: center; padding: 28px 0; border-bottom: 1px solid var(--line); }
.ex-status { font-size: 13px; font-weight: 700; color: var(--ink-3); letter-spacing: .05em; }
.ex-status.now { color: var(--seal); }
.exhibition h3 { font-family: var(--serif); font-size: 22px; font-weight: 800; line-height: 1.4; }
.exhibition p { color: var(--ink-2); font-size: 14px; }
.ex-date { font-family: var(--serif); font-size: 15px; color: var(--ink-2); text-align: right; white-space: nowrap; }
@media (max-width: 720px) {
  .exhibition { grid-template-columns: 1fr; gap: 6px; padding: 22px 0; }
  .ex-date { text-align: left; }
  .exhibition h3 { font-size: 19px; }
}

/* About */
.section-ink { background: var(--ink); color: var(--paper); }
.about-inner { display: grid; grid-template-columns: 200px 1fr; gap: 56px; align-items: center; }
.about-mark { font-family: 'Ma Shan Zheng', serif; font-size: 180px; line-height: 1; color: var(--paper); opacity: .9; text-align: center; }
.section-ink h2 { font-family: var(--serif); font-size: clamp(24px, 3.4vw, 34px); font-weight: 800; margin-bottom: 20px; }
.section-ink p { color: #cfc6b5; margin-bottom: 14px; max-width: 680px; }
@media (max-width: 720px) {
  .about-inner { grid-template-columns: 1fr; gap: 16px; }
  .about-mark { font-size: 110px; }
}

/* Contact */
.contact-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.contact-card { background: var(--white); border: 1px solid var(--line); padding: 28px; text-align: center; }
.contact-card h3 { font-family: var(--serif); font-size: 16px; color: var(--seal); margin-bottom: 8px; }
.contact-card a:hover { color: var(--seal); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 32px 0; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.site-footer p { font-size: 13px; color: var(--ink-3); }

/* Modal */
.modal { border: 0; padding: 0; background: var(--paper); width: min(1000px, calc(100% - 32px)); max-height: calc(100vh - 32px); margin: auto; box-shadow: 0 30px 80px rgba(0,0,0,.4); }
.modal::backdrop { background: rgba(20, 18, 15, .75); }
.modal[open] { animation: fadeUp .3s both; }
.modal-close { position: absolute; top: 8px; right: 8px; width: 44px; height: 44px; font-size: 30px; line-height: 1; z-index: 2; color: var(--ink-2); }
.modal-close:hover { color: var(--seal); }
.modal-body { display: grid; grid-template-columns: 1.1fr 1fr; }
.modal-art { background: var(--paper-2); padding: 32px; display: grid; place-items: center; }
.modal-art svg { width: 100%; max-width: 420px; height: auto; aspect-ratio: 3/4; background: var(--white); padding: 10px; box-shadow: var(--shadow); }
.modal-info { padding: 44px 36px 36px; overflow-y: auto; }
.modal-info .genre { font-size: 12px; letter-spacing: .15em; color: var(--seal); font-weight: 700; }
.modal-info h3 { font-family: var(--serif); font-size: 28px; font-weight: 800; line-height: 1.35; margin: 6px 0 4px; }
.modal-info .artist { font-size: 16px; color: var(--ink-2); margin-bottom: 20px; }
.modal-info dl { display: grid; grid-template-columns: 80px 1fr; gap: 8px 12px; font-size: 14px; border-top: 1px solid var(--line); padding-top: 16px; margin-bottom: 20px; }
.modal-info dt { color: var(--ink-3); }
.modal-info .desc { font-size: 15px; color: var(--ink-2); }
.modal-info .btn { margin-top: 24px; }
@media (max-width: 760px) {
  .modal { width: 100%; max-width: 100%; max-height: 100%; height: 100%; }
  .modal-body { grid-template-columns: 1fr; }
  .modal-art { padding: 48px 16px 20px; }
  .modal-art svg { max-width: 300px; }
  .modal-info { padding: 20px 16px 32px; }
  .modal-info h3 { font-size: 23px; }
}

/* To top */
.to-top { position: fixed; right: 16px; bottom: 16px; width: 46px; height: 46px; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; font-size: 18px; opacity: 0; pointer-events: none; transition: .3s; z-index: 40; }
.to-top.show { opacity: .85; pointer-events: auto; }
.to-top:hover { opacity: 1; background: var(--seal); }

:focus-visible { outline: 2px solid var(--seal); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } html { scroll-behavior: auto; } }
