:root {
  color-scheme: dark;
  --bg: #131313;
  --panel: #1b1b1b;
  --edge: #393938;
  --text: #f2f1ec;
  --muted: #b5b4ac;
  --accent: #efef78;
  font-family: Arial, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  background: var(--bg);
  color: var(--text);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 0; }
a { color: inherit; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .46; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
h1, h2, p { margin: 0; }

.site-header, .site-footer {
  min-height: 76px;
  padding-inline: clamp(1.25rem, 5.5vw, 6rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.site-header { border-bottom: 1px solid var(--edge); }
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  font-size: .95rem;
  font-weight: 800;
  letter-spacing: -.025em;
  text-decoration: none;
}

.brand-mark {
  height: .62rem;
  width: .62rem;
  flex: 0 0 .62rem;
  background: var(--accent);
  transform: rotate(-15deg);
}

.nav-link {
  font-size: .9rem;
  color: var(--muted);
  text-decoration: none;
  padding-block: .55rem;
}
.nav-link:hover { color: var(--accent); }

.site-main {
  width: min(100% - clamp(2.5rem, 11vw, 12rem), 90rem);
  margin-inline: auto;
  padding-bottom: clamp(4rem, 8vw, 8rem);
}

.masthead {
  min-height: clamp(10rem, 19vw, 17.5rem);
  padding: clamp(2.15rem, 4.6vw, 4.5rem) 0 clamp(1.6rem, 3.35vw, 3.25rem);
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: .8rem 2rem;
}

.masthead h1 {
  font-size: clamp(3.05rem, 8.7vw, 8.65rem);
  line-height: .99;
}
.masthead h1, .heading-preview p {
  font-family: var(--heading-font, inherit);
  font-weight: var(--heading-weight, 800);
  letter-spacing: var(--heading-tracking, -.095em);
}
[data-heading-font="pretendard"] {
  --heading-font: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --heading-weight: 800;
}
[data-heading-font="black"] {
  --heading-font: "Black Han Sans", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --heading-weight: 400;
  --heading-tracking: -.025em;
}
[data-heading-font="serif"] {
  --heading-font: "Noto Serif KR", "AppleMyungjo", Batang, serif;
  --heading-tracking: -.055em;
}

.masthead h1 span { color: var(--accent); margin-left: .035em; }
.masthead > p { font-size: 1rem; font-weight: 800; color: var(--muted); padding-bottom: .25rem; }

.project { min-width: 0; }
.project-feature { margin-bottom: clamp(2.8rem, 6vw, 5.4rem); }
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(2rem, 4vw, 4rem) clamp(1rem, 2vw, 2rem);
}

.project-image {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  width: 100%;
  padding: 0;
  aspect-ratio: 16 / 9;
  isolation: isolate;
  border: 1px solid #ffffff14;
  border-radius: 10px;
  background: #242422;
  color: var(--text);
}

.project-feature .project-image { aspect-ratio: 2.2; }
.project-feature .project-image.custom-thumbnail { aspect-ratio: 16 / 9; }

.project-image > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .26s ease, filter .26s ease;
}

.project-image.custom-thumbnail > img { object-fit: contain; }
.project-image:hover > img { transform: scale(1.025); filter: brightness(.75); }
.project-image.custom-thumbnail:hover > img { transform: none; }
.play {
  position: relative;
  display: grid;
  place-items: center;
  width: 3rem;
  aspect-ratio: 1;
  border: 1px solid #ffffff9e;
  background: #111111ad;
  border-radius: 50%;
  transition: color .18s ease, background .18s ease, border-color .18s ease;
}

.play::before {
  content: "";
  display: block;
  border-top: .39rem solid transparent;
  border-bottom: .39rem solid transparent;
  border-left: .58rem solid currentColor;
  margin-left: .13rem;
}
.project-feature .play { width: clamp(3rem, 6vw, 5.1rem); }
.project-image:hover .play, .project-image:focus-visible .play {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

.project-caption { padding-top: .9rem; }
.project-caption h2 { font-size: 1.06rem; line-height: 1.4; overflow-wrap: anywhere; }
.project-feature h2 { font-size: clamp(1.22rem, 2.25vw, 2rem); }
.project-caption p { color: var(--muted); margin-top: .26rem; font-size: .88rem; line-height: 1.5; }
.site-footer {
  display: grid;
  grid-template-columns: minmax(2.5rem, 1fr) minmax(0, max-content) minmax(2.5rem, 1fr);
  gap: .75rem;
  color: var(--muted);
  border-top: 1px solid var(--edge);
  font-size: .87rem;
}
.site-footer > span {
  grid-column: 2;
  text-align: center;
  overflow-wrap: anywhere;
}
.site-footer > .nav-link {
  grid-column: 3;
  justify-self: end;
}

.video-dialog {
  width: min(66rem, calc(100% - 2rem));
  max-height: calc(100% - 2rem);
  padding: 0;
  color: var(--text);
  border: 1px solid var(--edge);
  background: #1b1b1b;
}
.video-dialog::backdrop { background: #000d; }
.player-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: .7rem 1rem;
}
.player-header h2 { font-size: 1.05rem; }
.video-dialog iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; background: #000; }
.player-link { display: inline-block; font-size: .91rem; margin: .85rem 1rem; color: var(--muted); }
.player-link:hover { color: var(--accent); }
.plain-button { background: none; border: 1px solid var(--edge); color: var(--text); padding: .5rem .8rem; white-space: nowrap; }
.empty { color: var(--muted); padding: 2rem 0; }

.admin-main {
  width: min(100% - 2.5rem, 62rem);
  margin: clamp(2.2rem, 6vw, 5.5rem) auto 4rem;
}
.admin-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.75rem; }
.admin-heading h1 { font-size: clamp(1.9rem, 4vw, 3.2rem); letter-spacing: -.06em; }
.panel { padding: clamp(1rem, 3vw, 1.6rem); background: var(--panel); border: 1px solid var(--edge); }
.auth-panel p { margin-bottom: 1rem; color: var(--muted); }
.add-form h2, .editor-toolbar h2 { font-size: 1.2rem; }
.add-form fieldset {
  display: grid;
  grid-template-columns: 1.4fr 1fr max-content;
  align-items: end;
  gap: .8rem;
  margin: 1rem 0 0;
  padding: 0;
  border: 0;
}

.admin-main label { display: grid; gap: .45rem; min-width: 0; font-size: .9rem; }
.admin-main label > span { display: contents; }
.admin-main input, .brand-editor select {
  color: var(--text);
  background: var(--bg);
  border: 1px solid #535352;
  border-radius: .2rem;
  padding: .65rem .75rem;
  min-width: 0;
  width: 100%;
  font-size: 1rem;
}
.admin-main input::placeholder { color: #8d8d86; }

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 2.7rem;
  border: 1px solid #676763;
  border-radius: .2rem;
  padding: .6rem .8rem;
  background: var(--panel);
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.button:hover:not(:disabled) { border-color: var(--accent); }
.primary { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.primary:hover:not(:disabled) { background: #ffffa2; }
.muted { color: var(--muted); font-weight: 400; }

.editor-list { margin-top: 2rem; }
.editor-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem 1.25rem; }
.editor-toolbar p { color: var(--muted); margin-top: .4rem; font-size: .9rem; line-height: 1.5; }
.editor-list ol { margin: 0; padding: 0; list-style: none; }
.notice { min-height: 1.4rem; margin: .65rem 0; color: var(--accent); font-size: .91rem; line-height: 1.5; }
.notice.error { color: #ffb6a4; }
.editor-row {
  display: grid;
  grid-template-columns: minmax(6rem, 9rem) minmax(0, 1fr) auto;
  align-items: start;
  gap: .9rem;
  padding-block: 1rem;
  border-top: 1px solid var(--edge);
}
.editor-thumb { display: block; aspect-ratio: 16 / 9; background: var(--panel); }
.editor-thumb img { width: 100%; height: 100%; object-fit: cover; }
.editor-fields { display: grid; gap: .65rem; }
.editor-thumbnail-actions { display: flex; flex-wrap: wrap; gap: .35rem .65rem; }
.editor-actions { display: flex; flex-wrap: wrap; gap: .25rem; }
.editor-actions button {
  min-height: 2.5rem;
  padding: .45rem .6rem;
  border: 1px solid var(--edge);
  border-radius: .2rem;
  background: var(--panel);
  color: var(--text);
  font-size: .9rem;
}
.editor-actions button:hover:not(:disabled) { border-color: var(--accent); }
.editor-actions button:last-child { color: #ffb6a4; }
.editor-bottom { display: flex; justify-content: flex-end; margin-top: 1.1rem; }

@media (max-width: 57rem) { .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 42rem) {
  .site-header, .site-footer { min-height: 64px; }
  .masthead { align-items: start; flex-direction: column; justify-content: end; }
  .project-feature .project-image { aspect-ratio: 16 / 9; }
  .add-form fieldset { grid-template-columns: 1fr; }
  .editor-row { grid-template-columns: 5.3rem minmax(0, 1fr); }
  .editor-actions { grid-column: 2; }
}
@media (max-width: 31rem) { .project-grid { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }

.editor-bottom[hidden] { display: none; }
.auth-panel label { margin-bottom: 1rem; max-width: 28rem; }

.brand-logo { max-width: 11rem; max-height: 3rem; width: auto; height: auto; object-fit: contain; }
.wordmark, .masthead h1 { min-width: 0; overflow-wrap: anywhere; }
.brand-nav { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; align-items: center; }
.brand-editor { max-width: 38rem; }
.brand-fields { display: grid; gap: 1rem; }
.heading-preview {
  padding: .8rem;
  border: 1px solid var(--edge);
  background: var(--bg);
}
.heading-preview > span { font-size: .85rem; }
.heading-preview p {
  margin-block: .35rem 0;
  font-size: clamp(1.65rem, 5vw, 2.75rem);
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.brand-editor h2 { margin-bottom: 1rem; font-size: 1.1rem; }
.brand-editor .button { margin-top: 1rem; }
.brand-editor input[type="checkbox"] { width: auto; }
.brand-editor input[type="checkbox"] + span { display: inline; }
.brand-editor .remove-logo { display: flex; gap: .5rem; align-items: center; }
.brand-editor .notice { min-height: auto; margin-bottom: 1rem; }
.brand-editor .logo-preview { padding: .65rem; background: var(--bg); border: 1px solid var(--edge); width: fit-content; }
@media (max-width: 31rem) { .brand-logo { max-width: 7rem; max-height: 2.4rem; } }
