:root {
  color-scheme: dark;
  --ink: #f4f0e8;
  --ink-soft: rgba(244, 240, 232, .66);
  --ink-faint: rgba(244, 240, 232, .38);
  --museum: #071421;
  --museum-deep: #030b12;
  --museum-blue: #0d2638;
  --charcoal: #172027;
  --brass: #b89455;
  --brass-light: #d8bd80;
  --line: rgba(216, 189, 128, .24);
  --shadow: 0 36px 90px rgba(0, 0, 0, .46);
  --ease: cubic-bezier(.22, .78, .23, 1);
  --serif: "Noto Serif KR", "Batang", serif;
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  margin: 0;
  background: var(--museum);
}

body {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  font-family: "Pretendard", "Noto Sans KR", "Malgun Gothic", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  padding: 12px 18px;
  transform: translateY(-160%);
  border-radius: 100px;
  background: #f5f1e8;
  color: var(--charcoal);
  text-decoration: none;
}
.skip-link:focus-visible { transform: none; }

/* 배경 */
.ambient {
  position: fixed;
  z-index: 0;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .5;
  pointer-events: none;
}
.ambient-one {
  top: -18vh; left: -12vw;
  width: 62vw; height: 62vw;
  background: radial-gradient(circle, rgba(184, 148, 85, .30), transparent 68%);
}
.ambient-two {
  right: -16vw; bottom: -22vh;
  width: 56vw; height: 56vw;
  background: radial-gradient(circle, rgba(13, 38, 56, .95), transparent 70%);
}
.grain {
  position: fixed;
  z-index: 1;
  inset: 0;
  opacity: .05;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .8) .5px, transparent .5px);
  background-size: 3px 3px;
}

/* 헤더 */
.site-header {
  position: relative;
  z-index: 5;
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  padding: 16px clamp(16px, 4vw, 44px);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(3, 11, 18, .82), rgba(3, 11, 18, 0));
  backdrop-filter: blur(8px);
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}
.brand img { width: 34px; height: 34px; object-fit: contain; }
.brand-rule { width: 1px; height: 22px; background: var(--line); }
.brand-title {
  font-family: var(--serif);
  font-size: clamp(1rem, 2.4vw, 1.25rem);
  letter-spacing: .06em;
}

.view-switch {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: rgba(7, 20, 33, .6);
}
.switch-btn {
  padding: 8px 20px;
  border: 0;
  border-radius: 100px;
  background: transparent;
  color: var(--ink-soft);
  font-size: .88rem;
  letter-spacing: .04em;
  cursor: pointer;
  transition: background .3s var(--ease), color .3s var(--ease);
}
.switch-btn:hover { color: var(--ink); }
.switch-btn.is-active {
  background: var(--brass);
  color: #14100a;
  font-weight: 600;
}

.ghost-btn {
  padding: 8px 18px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: transparent;
  color: var(--ink-soft);
  font-size: .84rem;
  cursor: pointer;
  transition: border-color .3s var(--ease), color .3s var(--ease);
}
.ghost-btn:hover { border-color: var(--brass); color: var(--ink); }

/* 뷰 */
main {
  position: relative;
  z-index: 2;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.view { display: none; height: 100%; }
.view.is-active { display: block; }

/* 크레딧 */
.view-credits {
  position: relative;
  overflow: hidden;
}
.credits-stage {
  height: 100%;
  overflow: hidden;
}
.credits-roll {
  padding: 0 clamp(16px, 5vw, 40px);
  text-align: center;
  will-change: transform;
}

.credits-opening { padding: 22vh 0 14vh; }
.credits-opening .eyebrow {
  max-width: none;
  margin: 0 auto 18px;
  color: var(--brass-light);
  font-size: .78rem;
  letter-spacing: .42em;
}
.credits-opening h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2rem, 6vw, 3.4rem);
  font-weight: 500;
  line-height: 1.3;
}
.credits-opening p {
  margin: 20px auto 0;
  max-width: 34em;
  color: var(--ink-soft);
  line-height: 1.9;
}

.credits-group { padding: 8vh 0; }
.credits-group-head {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
  margin-bottom: 40px;
}
.credits-group-head .rule {
  width: clamp(28px, 8vw, 90px);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--brass));
}
.credits-group-head .rule.right { background: linear-gradient(90deg, var(--brass), transparent); }
.credits-group-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.3rem, 3.6vw, 2rem);
  font-weight: 500;
  color: var(--brass-light);
  letter-spacing: .14em;
}
.credits-group-head .tier-en {
  display: block;
  margin-top: 6px;
  color: var(--ink-faint);
  font-size: .68rem;
  font-family: "Pretendard", "Noto Sans KR", sans-serif;
  letter-spacing: .34em;
}

.credits-names {
  display: flex;
  flex-wrap: wrap;
  gap: 16px clamp(28px, 6vw, 64px);
  justify-content: center;
  margin: 0 auto;
  max-width: 1040px;
  padding: 0;
  list-style: none;
}
.credits-names li {
  font-family: var(--serif);
  font-size: clamp(1.05rem, 2.4vw, 1.5rem);
  letter-spacing: .05em;
  line-height: 1.7;
}
.credits-names li span {
  display: block;
  margin-top: 2px;
  color: var(--ink-faint);
  font-family: "Pretendard", "Noto Sans KR", sans-serif;
  font-size: .62em;
  letter-spacing: .04em;
}

.credits-closing {
  padding: 12vh 0 26vh;
  color: var(--ink-soft);
}
.credits-closing p { margin: 0 0 10px; line-height: 1.9; }
.credits-closing strong {
  display: block;
  margin-bottom: 18px;
  font-family: var(--serif);
  font-size: clamp(1.2rem, 3vw, 1.7rem);
  font-weight: 500;
  color: var(--ink);
}

.credits-fade {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  height: 18vh;
  pointer-events: none;
}
.credits-fade-top { top: 0; background: linear-gradient(180deg, var(--museum), transparent); }
.credits-fade-bottom { bottom: 0; background: linear-gradient(0deg, var(--museum), transparent); }

.header-tools {
  display: flex;
  gap: 8px;
  align-items: center;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color .3s var(--ease), color .3s var(--ease);
}
.icon-btn:hover { border-color: var(--brass); color: var(--brass-light); }
.icon-btn svg { width: 17px; height: 17px; }

/* 설정 모달 */
.modal-backdrop {
  position: fixed;
  z-index: 900;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: clamp(12px, 3vw, 22px);
  background: rgba(3, 11, 18, .62);
  backdrop-filter: blur(3px);
}
.modal-backdrop[hidden] { display: none; }

.modal {
  width: min(420px, 100%);
  margin-top: 66px;
  padding: 22px 24px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(7, 20, 33, .96);
  box-shadow: var(--shadow);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}
.modal-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.14rem;
  font-weight: 500;
  letter-spacing: .1em;
}

.setting-label { margin-bottom: 14px; }
.setting-name {
  margin: 0 0 5px;
  font-size: .94rem;
}
.setting-desc {
  margin: 0;
  color: var(--ink-faint);
  font-size: .8rem;
  line-height: 1.6;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}
.segmented button {
  padding: 10px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--ink-soft);
  font-size: .86rem;
  cursor: pointer;
  transition: background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
}
.segmented button:hover { border-color: var(--brass); color: var(--ink); }
.segmented button[aria-checked="true"] {
  border-color: var(--brass);
  background: var(--brass);
  color: #14100a;
  font-weight: 600;
}

.modal-note {
  margin: 20px 0 0;
  color: var(--ink-faint);
  font-size: .76rem;
}

/* 명단 */
.view-list {
  overflow-y: auto;
  padding: clamp(22px, 5vw, 48px) clamp(16px, 5vw, 56px) 60px;
}
.view-list.is-active { display: flex; flex-direction: column; }

.list-head {
  display: flex;
  gap: 24px;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 30px;
}
.eyebrow {
  margin: 0 0 12px;
  color: var(--brass-light);
  font-size: .72rem;
  letter-spacing: .38em;
}
.list-head h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.7rem, 4.4vw, 2.7rem);
  font-weight: 500;
}
.list-note {
  margin: 14px 0 0;
  color: var(--ink-soft);
  font-size: .92rem;
  line-height: 1.8;
}

.search-bubble {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: min(320px, 100%);
  padding: 11px 18px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: rgba(7, 20, 33, .6);
  color: var(--ink-faint);
}
.search-bubble svg { width: 17px; height: 17px; flex: none; }
.search-bubble input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  outline: none;
}
.search-bubble input::placeholder { color: var(--ink-faint); }

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 14px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: none;
  padding: 9px 18px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: transparent;
  color: var(--ink-soft);
  font-size: .9rem;
  cursor: pointer;
  transition: background .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease);
}
.tab:hover { border-color: var(--brass); color: var(--ink); }
.tab .count {
  padding: 1px 8px;
  border-radius: 100px;
  background: rgba(244, 240, 232, .1);
  font-size: .74rem;
}
.tab[aria-selected="true"] {
  border-color: var(--brass);
  background: var(--brass);
  color: #14100a;
  font-weight: 600;
}
.tab[aria-selected="true"] .count { background: rgba(20, 16, 10, .18); }

.tier-block { margin-bottom: 46px; }
.tier-block-head {
  display: flex;
  gap: 14px;
  align-items: baseline;
  margin-bottom: 18px;
}
.tier-block-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--brass-light);
  letter-spacing: .1em;
}
.tier-block-head .desc { color: var(--ink-faint); font-size: .82rem; }
.tier-block-head .line {
  flex: 1;
  height: 1px;
  background: var(--line);
}

.donor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
  gap: 10px;
}
.donor-card {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(13, 38, 56, .58), rgba(7, 20, 33, .34));
  transition: transform .3s var(--ease), border-color .3s var(--ease);
}
.donor-card:hover { transform: translateY(-3px); border-color: var(--brass); }
.donor-card .name {
  font-family: var(--serif);
  font-size: 1.12rem;
  letter-spacing: .04em;
}
.donor-card .meta {
  margin-top: 7px;
  color: var(--ink-faint);
  font-size: .78rem;
  letter-spacing: .03em;
}
.donor-card .note {
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: .78rem;
}

.empty {
  padding: 60px 0;
  color: var(--ink-faint);
  text-align: center;
}

.site-footer {
  position: relative;
  z-index: 3;
  display: flex;
  gap: 10px;
  justify-content: center;
  padding: 14px;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: .74rem;
  letter-spacing: .08em;
}

:focus-visible { outline: 2px solid var(--brass-light); outline-offset: 3px; }

@media (max-width: 640px) {
  .site-header { flex-wrap: wrap; justify-content: center; }
  .brand-title { font-size: 1rem; }
  .ghost-btn { display: none; }
  .modal { margin-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .donor-card { transition: none; }
}

/* 명단 준비 중 */
.credits-pending {
  padding: 10vh 0;
  color: var(--ink-soft);
}
.credits-pending .pending-mark {
  margin: 0 0 22px;
  color: var(--brass);
  font-size: 1.6rem;
  letter-spacing: .5em;
}
.credits-pending p {
  margin: 0 auto 10px;
  max-width: 32em;
  font-family: var(--serif);
  font-size: clamp(1.05rem, 2.6vw, 1.45rem);
  line-height: 1.9;
}

.pending-block {
  display: grid;
  place-content: center;
  gap: 12px;
  min-height: 38vh;
  padding: 40px 20px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  text-align: center;
  color: var(--ink-soft);
}
.pending-block .pending-title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  color: var(--brass-light);
  letter-spacing: .1em;
}
.pending-block p { margin: 0; line-height: 1.9; }
