:root {
  --paper: #ffffff;
  --paper-deep: #fafafa;
  --ink: #202124;
  --muted: #737373;
  --line: #e7e7e7;
  --accent: #0095f6;
  --accent-soft: #eef7ff;
  --chip-bg: #eaf5fb;
  --chip-border: #c8e3f2;
  --chip-ink: #173b50;
  --card: #ffffff;
  --ig-yellow: #fcaf45;
  --ig-coral: #f77737;
  --ig-rose: #d62976;
  --ig-violet: #7b3fe4;
  --gradient: linear-gradient(135deg, var(--ig-yellow), var(--ig-coral), var(--ig-rose), var(--ig-violet));
  --radius: 14px;
  --shadow: 0 10px 28px rgba(32, 33, 36, 0.07);
  --sans: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --serif: "Nanum Myeongjo", "Noto Serif KR", Georgia, serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 8px 12px; background: var(--ink); color: var(--paper); border-radius: 8px; }
.skip-link:focus { top: 10px; }

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 18px clamp(20px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-inner { width: 100%; max-width: 1380px; margin: 0 auto; display: grid; grid-template-columns: 1fr minmax(250px, 330px) 1fr; align-items: center; gap: 24px; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 750;
  letter-spacing: -0.025em;
  white-space: nowrap;
}
.brand em { font-style: normal; color: var(--accent); }
.brand-mark { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--gradient); color: #fff; font: italic 700 18px/1 var(--serif); box-shadow: 0 8px 20px rgba(214, 41, 118, .16); }

.nav { display: flex; justify-content: center; gap: 22px; font-size: 12px; font-weight: 600; color: var(--muted); }
.nav a:hover { color: var(--ink); }

.quick-search {
  margin-left: auto;
  display: flex;
  gap: 10px;
  padding-left: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-deep);
}
.search-icon { color: var(--muted); font-size: 18px; }
.quick-search input {
  flex: 1 1 auto;
  min-width: 0;
  width: min(260px, 40vw);
  padding: 10px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font: inherit;
  font-size: 14px;
}
.quick-search button {
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 8px 14px;
  margin: 3px;
  border-radius: 9px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.quick-search:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

.page {
  padding: clamp(28px, 2.6vw, 44px) clamp(18px, 2.2vw, 48px) 72px;
  max-width: none;
  margin: 0 auto;
}

.profile-hero { max-width: 1380px; margin: 0 auto 24px; display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; align-items: center; gap: 24px; }
.profile-ring { width: 92px; height: 92px; padding: 4px; border-radius: 50%; background: var(--gradient); }
.profile-ring img, .profile-ring>span { width: 100%; height: 100%; border-radius: inherit; border: 4px solid var(--paper); object-fit: cover; background: var(--ink); color: var(--paper); display: grid; place-items: center; font: italic 700 30px var(--serif); }
.profile-hero h1 { margin: 5px 0 7px; font-family: var(--serif); font-size: clamp(36px, 4.2vw, 60px); line-height: .98; font-weight: 500; letter-spacing: -.045em; text-wrap: balance; }
.profile-hero .eyebrow { color: var(--accent); font-weight: 750; }
.profile-hero .lede { font-size: 14px; }
.profile-stats { justify-content: flex-end; gap: 24px; }
.profile-stats dd { font-family: var(--sans); font-size: 21px; font-weight: 650; }

.story-row { max-width: 1380px; margin: 0 auto; padding: 4px 2px 24px; display: flex; gap: 24px; overflow-x: auto; scrollbar-width: thin; border-bottom: 1px solid var(--line); }
.story { flex: 0 0 76px; text-align: center; color: var(--muted); font-size: 11px; }
.story-orb { width: 64px; height: 64px; margin: 0 auto 7px; padding: 3px; border-radius: 50%; border: 1px solid var(--line); display: block; }
.story.active .story-orb { background: var(--gradient); }
.story-orb>span { width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center; background: var(--paper); border: 2px solid var(--paper); color: var(--ink); font-size: 18px; }
.story:hover, .story:focus-visible { color: var(--ink); }
.story:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

.gallery-shell { max-width: 1380px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 32px; align-items: start; }
.gallery-main, .archive-rail { min-width: 0; }
.gallery-heading { display: flex; justify-content: space-between; align-items: center; margin: 24px 0 15px; }
.gallery-heading h2 { margin: 0; font-size: 13px; }
.gallery-heading span { color: var(--muted); font-size: 11px; }
.gallery-shell .masonry { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.gallery-shell .card { border-radius: var(--radius); box-shadow: none; background: var(--paper); }
.gallery-shell .card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.gallery-shell .card-feature { grid-column: 1 / -1; border-color: var(--line); }
.gallery-shell .card-feature .card-media { aspect-ratio: 16 / 9; }
.gallery-shell .card:not(.card-feature) .card-media { aspect-ratio: 4 / 5; }
.gallery-shell .card-media img { transition: transform 220ms ease-out; }
.gallery-shell .card:hover .card-media img { transform: scale(1.015); }
.gallery-shell .card-feature .card-body { padding: 19px 21px 21px; }
.gallery-shell .card-feature .card-body h2 { font-size: clamp(23px, 2.5vw, 34px); line-height: 1.16; -webkit-line-clamp: 3; }
.gallery-shell .card-feature .summary { font-size: 14px; max-width: 68ch; }
.gallery-shell .badge { color: var(--ink); background: rgba(255,255,255,.88); backdrop-filter: blur(10px); }

.archive-rail { display: flex; flex-direction: column; gap: 16px; padding-top: 24px; }
.rail-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; padding: 18px; align-items: start; }
.rail-filters .rail-title { grid-column: 1 / -1; align-self: start; color: var(--ink); font-size: 13px; font-weight: 700; }
.rail-filters label:nth-of-type(3), .rail-filters label:nth-of-type(4), .rail-filters .check, .rail-filters .primary { grid-column: 1 / -1; }
.rail-filters label { gap: 4px; }
.rail-filters select, .rail-filters input { width: 100%; border-color: var(--line); border-radius: 9px; background: var(--paper); }
.rail-filters .check { justify-content: flex-start; }
.rail-filters .primary { width: 100%; }
.rail-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); padding: 18px; }
.rail-card h2 { margin: 0 0 12px; font-family: var(--sans); font-size: 13px; }
.insight-card { overflow: hidden; padding: 0; background: linear-gradient(150deg, #fff7ed, #fff 56%, #f7efff); }
.insight-label { padding: 11px 17px; border-bottom: 1px solid rgba(214, 41, 118, .12); color: var(--ig-rose); font-size: 10px; font-weight: 750; letter-spacing: .14em; }
.insight-card p { margin: 0; padding: 17px; font-family: var(--serif); font-size: 18px; line-height: 1.45; }
.insight-card a { display: inline-block; margin: 0 17px 17px; color: var(--accent); font-size: 12px; }
.collection-card .plain { margin-bottom: 12px; }
.collection-card .plain a { color: var(--ink); }
.outline-link { display: inline-block; margin-top: 4px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 999px; font-size: 11px; }

.card .summary, .panel .summary, .original { color: #4d4d4d; }
.panel { border-radius: var(--radius); box-shadow: none; }
.button, button { transition: background-color 140ms ease-out, border-color 140ms ease-out, transform 140ms ease-out; }
button:active, .primary:active { transform: translateY(1px); }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (max-width: 1100px) {
  .gallery-shell { grid-template-columns: minmax(0, 1fr) 290px; gap: 22px; }
}

@media (max-width: 880px) {
  .topbar-inner { grid-template-columns: 1fr auto; }
  .topbar-inner .quick-search { grid-column: 1 / -1; }
  .nav { justify-content: flex-end; }
  .profile-hero { grid-template-columns: 72px minmax(0, 1fr); }
  .profile-ring { width: 72px; height: 72px; }
  .profile-stats { grid-column: 1 / -1; justify-content: flex-start; }
  .gallery-shell { grid-template-columns: minmax(0, 1fr); }
  .archive-rail { padding-top: 0; }
  .rail-filters { order: 2; }
  .insight-card { order: 1; }
  .collection-card { order: 3; }
}

@media (max-width: 560px) {
  .page { padding-left: 16px; padding-right: 16px; }
  .topbar { padding: 13px 16px; }
  .topbar-inner { gap: 11px; }
  .brand span:last-child { max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
  .nav { gap: 14px; }
  .profile-hero { gap: 15px; }
  .profile-hero h1 { font-size: 38px; }
  .story-row { gap: 15px; }
  .gallery-shell .masonry { grid-template-columns: 1fr; }
  .gallery-shell .card-feature .card-media { aspect-ratio: 4 / 5; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  .gallery-shell .card:hover, .gallery-shell .card:hover .card-media img { transform: none; }
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 26px;
}
.hero.compact { padding-bottom: 18px; }
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 6px 0 8px;
}
.eyebrow {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
.lede { margin: 0; color: var(--muted); max-width: 56ch; }

.stat-row {
  display: flex;
  gap: 28px;
  margin: 0;
  flex-wrap: wrap;
}
.stat-row div { min-width: 64px; }
.stat-row dt { font-size: 11px; color: var(--muted); letter-spacing: 0.08em; }
.stat-row dd { margin: 2px 0 0; font-family: var(--serif); font-size: 26px; }
.stat-row.small dd { font-size: 20px; }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 28px;
}
.filters label { display: flex; flex-direction: column; gap: 5px; font-size: 11px; color: var(--muted); }
.filters select, .filters input {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefb;
  font: inherit;
  font-size: 13px;
  color: var(--ink);
}
.filters .check { flex-direction: row; align-items: center; gap: 7px; font-size: 13px; }
.filters .check input { width: auto; }

button, .primary {
  font: inherit;
  cursor: pointer;
}
button.primary, a.primary {
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
}
button.primary:hover, a.primary:hover { background: var(--accent); border-color: var(--accent); }

.masonry {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
  align-items: start;
}
.masonry.narrow { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 0;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 20px 40px rgba(60, 45, 25, 0.12); }
.card-media {
  position: relative;
  display: block;
  background: var(--paper-deep);
  aspect-ratio: 4 / 3;
  overflow: hidden;
}
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.placeholder {
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  background:
    repeating-linear-gradient(45deg, rgba(180, 72, 42, 0.07) 0 10px, transparent 10px 20px),
    var(--paper-deep);
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.06em;
}
.badge {
  position: absolute;
  left: 10px;
  top: 10px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.92);
  font-size: 11px;
  color: var(--accent);
}
.card-body { padding: 14px 16px 16px; }
.card-body h2 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card .summary {
  margin: 0 0 8px;
  color: #4a443b;
  font-size: 13px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.panel .summary { margin: 0 0 14px; color: #4a443b; font-size: 14px; }

.load-more {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 26px 0 8px;
}
.load-more[hidden] { display: none; }
.load-more .primary:disabled { opacity: 0.55; cursor: default; }
.load-more .hint { margin: 0; min-height: 16px; }
.meta { margin: 0; color: var(--muted); font-size: 12px; }
.meta span { margin: 0 3px; }
.star { color: var(--accent); margin-left: 4px; }

.empty { padding: 60px 20px; text-align: center; color: var(--muted); }

.detail { max-width: 1360px; margin: 0 auto; }
.back { color: var(--muted); font-size: 13px; }
.detail-head { margin: 18px 0 26px; }
.detail-head h1 {
  font-family: var(--serif);
  font-size: clamp(26px, 3.4vw, 40px);
  line-height: 1.3;
  margin: 6px 0 6px;
  letter-spacing: -0.02em;
}
.original-title { margin: 0 0 8px; color: var(--muted); font-size: 14px; }

.inline { display: inline-flex; gap: 8px; align-items: center; margin-top: 10px; }
.tag-form { width: 100%; }
.tag-form input { flex: 1; margin-bottom: 0; }
.tag-form button, .panel form button { white-space: nowrap; }
.panel form select { margin-bottom: 9px; }
.pill {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 13px;
}
.pill.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.viewer { margin-bottom: 26px; }
.viewer-stage {
  display: grid;
  place-items: center;
  background: #1c1a17;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  min-height: 240px;
}
.viewer-slide { display: none; margin: 0; width: 100%; justify-content: center; }
.viewer-slide.active { display: flex; }
.viewer-slide img {
  max-height: min(78vh, 900px);
  width: auto;
  max-width: 100%;
  object-fit: contain;
  cursor: zoom-in;
}
.viewer-slide video { max-height: min(78vh, 900px); width: auto; max-width: 100%; }
.viewer-slide .link-only { padding: 56px 28px; text-align: center; color: #eee6d8; }
.viewer-slide .link-only a { color: #f0b39a; font-size: 13px; }
.viewer-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 10px 0 4px;
}
.viewer-nav {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 17px;
  line-height: 1;
}
.viewer-counter { font-size: 12px; color: var(--muted); min-width: 64px; text-align: center; }
.viewer-thumbs {
  list-style: none;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 0 4px;
  margin: 0;
}
.viewer-thumb {
  width: 68px;
  height: 52px;
  padding: 0;
  border-radius: 8px;
  border: 2px solid transparent;
  background: var(--paper-deep);
  overflow: hidden;
}
.viewer-thumb.active { border-color: var(--accent); }
.viewer-thumb img { width: 100%; height: 100%; object-fit: cover; }
.viewer-thumb .thumb-label { font-size: 10px; color: var(--muted); }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(16, 14, 12, 0.94);
}
.lightbox[hidden] { display: none; }
.lightbox img {
  max-width: 94vw;
  max-height: 92vh;
  width: auto;
  height: auto;
  object-fit: contain;
  cursor: zoom-out;
}
.lightbox-close,
.lightbox-nav {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
  color: #f5efe4;
  border-radius: 999px;
  width: 44px;
  height: 44px;
  font-size: 22px;
  line-height: 1;
}
.lightbox-close { top: 18px; right: 18px; }
.lightbox-nav { top: 50%; transform: translateY(-50%); }
.lightbox-nav.prev { left: 18px; }
.lightbox-nav.next { right: 18px; }
body.lightbox-open { overflow: hidden; }

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr);
  gap: 22px;
  align-items: start;
}
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 18px;
}
.panel h2 {
  font-family: var(--serif);
  font-size: 17px;
  margin: 0 0 12px;
}
.panel h3 { font-size: 12px; letter-spacing: 0.06em; color: var(--muted); margin: 18px 0 7px; text-transform: uppercase; }

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; }
.chips li {
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--chip-border);
  background: var(--chip-bg);
  color: var(--chip-ink);
  font-size: 12px;
  font-weight: 550;
}
.ideas { margin: 0; padding-left: 18px; font-size: 14px; }
.ideas li { margin-bottom: 5px; }
.muted { color: var(--muted); }
.tag-note { display: inline-block; padding: 3px 7px; border-radius: 999px; background: var(--accent-soft); font-size: 10px; color: #006aa8; letter-spacing: 0.04em; margin-left: 6px; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.tags span { font-size: 12px; color: var(--muted); }
.original { white-space: pre-wrap; font-size: 13px; color: #4a443b; }
details summary { cursor: pointer; font-size: 13px; color: var(--accent); }

textarea, input[type="text"], input[type="number"], select {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fffefb;
  font: inherit;
  font-size: 14px;
  margin-bottom: 9px;
}
textarea { resize: vertical; }
.hint { font-size: 11px; color: var(--muted); margin: 4px 0 10px; }
.notice {
  padding: 11px 16px;
  background: var(--accent-soft);
  border-radius: 10px;
  color: #7d2f18;
  font-size: 13px;
  margin-bottom: 18px;
}
.plain { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.plain li { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--line); }

.collections-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 26px; align-items: start; }
.collection-list { list-style: none; padding: 0; margin: 18px 0 0; }
.collection-list a { display: flex; justify-content: space-between; padding: 8px 10px; border-radius: 8px; font-size: 13px; }
.collection-list li.active a, .collection-list a:hover { background: var(--paper-deep); }
.section-title { font-family: var(--serif); font-size: 22px; margin: 0 0 6px; }
.section-title span { font-family: var(--sans); font-size: 12px; color: var(--muted); margin-left: 8px; }

.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.panel.wide { margin-top: 4px; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-weight: 500; color: var(--muted); font-size: 11px; letter-spacing: 0.06em; border-bottom: 1px solid var(--line); padding: 8px 6px; }
.table td { padding: 9px 6px; border-bottom: 1px solid #eee6d8; }
.mono { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 12px; }
.status { padding: 2px 8px; border-radius: 999px; background: var(--paper-deep); font-size: 11px; }
.status.committed { background: #dcecd9; color: #2f5a2b; }
.status.conflict, .status.blocked_rights, .status.blocked_storage { background: var(--accent-soft); color: #7d2f18; }

.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 22px clamp(20px, 4vw, 56px) 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

@media (max-width: 860px) {
  .topbar { flex-wrap: wrap; gap: 12px; }
  .quick-search { width: 100%; margin-left: 0; }
  .quick-search input { width: 100%; }
  .detail-grid, .collections-layout { grid-template-columns: 1fr; }
  .viewer-slide img, .viewer-slide video { max-height: 58vh; }
  .viewer-thumb { width: 56px; height: 44px; }
  .hero { flex-direction: column; align-items: flex-start; }
  .stat-row { gap: 18px; }
  .masonry { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .card { border-radius: 10px; }
  .card-body { padding: 11px 12px 13px; }
  .card-body h2 { font-size: 14px; }
  .page { padding: 22px 16px 48px; }
}

@media (max-width: 520px) {
  .masonry { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .filters { gap: 10px; }
  .filters label { flex: 1 1 45%; }
}
