:root {
  --bg: #142850;
  --surface: #27496d;
  --ink: #eaf4fb;
  --muted: #a8c3d8;
  --line: #0c7b93;
  --accent: #00a8cc;
  --alert: #ff7aa8;
  --on-accent: #142850;
  --display: "Do Hyeon", "IBM Plex Sans KR", "Malgun Gothic", sans-serif;
  --body: "IBM Plex Sans KR", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  --mono: "IBM Plex Mono", Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.7 var(--body); word-break: keep-all; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.2; margin: 0; text-wrap: balance; }
h1:focus { outline: none; }
p { margin: 0; }
a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, .editor:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.wrap {
  width: min(1120px, 100%);
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.mono { font: 500 13px/1.5 var(--mono); letter-spacing: .02em; }
.muted { color: var(--muted); }

.notice { border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.notice .wrap { padding-block: 8px; }

.top .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; justify-content: space-between; padding-block: 20px; }
.brand { font-family: var(--display); font-size: 24px; text-decoration: none; }
.top nav { display: flex; gap: 20px; font-size: 15px; font-weight: 500; }
.top nav a { text-decoration: none; }
.top nav a:hover { color: var(--accent); }

.shot { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border: 2px solid var(--ink); background: var(--line); }
.shot-empty { display: flex; align-items: center; justify-content: center; padding: 12px; font: 400 clamp(1.4rem, 3vw, 2rem)/1.2 var(--display); text-align: center; }
.empty { padding-block: 12px; }
.card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 24px; }
.card { display: grid; gap: 12px; align-content: start; text-decoration: none; }
.card-text { display: grid; gap: 4px; }
.card strong { font: 400 26px/1.2 var(--display); }
.card:hover strong { color: var(--accent); }
.card:hover .shot { border-color: var(--accent); }

.btn { display: inline-block; border: 2px solid var(--ink); background: none; color: var(--ink); padding: 6px 14px; font: 700 14px/1.5 var(--body); text-decoration: none; cursor: pointer; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn:hover:not(:disabled) { transform: translate(-2px, -2px); box-shadow: 2px 2px 0 var(--ink); }
.btn:disabled { opacity: .35; cursor: default; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

.section { padding-block: 40px 64px; }
.section + .section { border-top: 2px solid var(--ink); padding-top: 48px; }
.head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; margin-bottom: 20px; }
.head h1, .head h2 { font-size: clamp(2rem, 4.4vw, 3rem); }

.stage { --w: 56%; --shift: 78%; position: relative; aspect-ratio: 16 / 5.04; overflow: hidden; touch-action: pan-y; user-select: none; }
.slide { position: absolute; top: 0; left: 50%; width: var(--w); z-index: 1; opacity: .55; filter: blur(3px); transform: translateX(calc(-50% + var(--d) * var(--shift))) scale(.82); transition: transform .35s ease, opacity .35s ease, filter .35s ease; }
.slide.active { z-index: 2; opacity: 1; filter: none; transform: translateX(-50%); }
.slide.far { opacity: 0; pointer-events: none; }
.slide:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.slide-arrow { position: absolute; top: 50%; z-index: 3; width: 44px; height: 44px; margin-top: -22px; border: 2px solid var(--ink); background: var(--surface); color: var(--ink); font: 700 20px/1 var(--body); cursor: pointer; }
.slide-arrow:hover { background: var(--ink); color: var(--bg); }
#slide-prev { left: 8px; }
#slide-next { right: 8px; }
.slide-text { display: grid; gap: 8px; justify-items: center; max-width: 40em; margin: 20px auto 0; text-align: center; }
.slide-text h2 { font-size: clamp(2rem, 4vw, 2.8rem); }
.slide-text .more { color: var(--accent); text-decoration: none; }
.slide-text .more:hover { text-decoration: underline; }

.board-tools { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.tab { border: 1px solid var(--line); background: none; color: var(--muted); padding: 3px 12px; font: 500 14px/1.5 var(--body); cursor: pointer; }
.tab[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.board { width: 100%; border-collapse: collapse; border-top: 2px solid var(--ink); font-size: 15px; background: var(--surface); }
.board th { padding: 8px 10px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 500; text-align: center; }
.board th.b-title { text-align: left; }
.board td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: center; color: var(--muted); font: 500 13px/1.5 var(--mono); white-space: nowrap; }
.board td.b-title { width: 100%; text-align: left; white-space: normal; font: 400 15px/1.5 var(--body); color: var(--ink); }
.board td.b-title a { text-decoration: none; }
.board td.b-title a:hover { color: var(--accent); text-decoration: underline; }
.board tbody tr:hover { background: var(--bg); }
.tag { color: var(--accent); font-weight: 700; font-size: 13px; margin-right: 6px; white-space: nowrap; }
.board-more { margin-top: 12px; text-align: right; font-weight: 500; }
.board-more a { text-decoration: none; color: var(--accent); }

.about { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 48px; }
.about-copy { display: grid; gap: 14px; max-width: 34em; align-content: start; }
.about-copy h2 { font-size: 36px; }
.about-side { display: grid; gap: 20px; align-content: start; min-width: 0; }
.about-side h3 { font-size: 20px; margin-bottom: 6px; }
.contacts { display: grid; gap: 6px; list-style: none; margin: 0; padding: 0; }
.contacts li { display: flex; align-items: center; gap: 8px; }
.contact-icon { flex: none; width: 16px; height: 16px; }
.contact { user-select: all; overflow-wrap: anywhere; min-width: 0; }

.back { display: inline-block; padding-block: 4px 20px; font-weight: 500; text-decoration: none; }
.back:hover { color: var(--accent); }
.detail-head { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 32px; padding-bottom: 56px; }
.detail-info { display: grid; gap: 16px; align-content: start; min-width: 0; }
.detail-info h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); }
.spec { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 2px 12px; margin: 0; font-size: 15px; }
.spec dt { color: var(--muted); }
.spec dd { margin: 0; }
.block { border-top: 2px solid var(--ink); padding-block: 40px; }
.block h2 { font-size: 32px; }
.block > h2 { margin-bottom: 20px; }

.post { background: var(--surface); border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.post-head { display: grid; gap: 6px; padding: 16px clamp(14px, 3vw, 28px); border-bottom: 1px solid var(--line); }
.post-head h1 { font-size: clamp(1.7rem, 3.6vw, 2.4rem); }
.post-meta { display: flex; flex-wrap: wrap; gap: 2px 14px; color: var(--muted); }
.post-body { padding: 24px clamp(14px, 3vw, 28px); max-width: 780px; line-height: 1.8; overflow-wrap: anywhere; }
.rich h3 { font-size: 21px; margin: 18px 0 4px; color: var(--accent); }
.rich h3:first-child { margin-top: 0; }
.rich p, .rich ul, .rich ol, .rich blockquote, .rich pre { margin: 0 0 10px; }
.rich img { display: block; max-width: 100%; height: auto; margin: 10px 0; }
.rich iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; margin: 10px 0; }
.rich blockquote { padding-left: 14px; border-left: 3px solid var(--accent); color: var(--muted); }
.rich pre { padding: 12px; background: var(--bg); font: 500 14px/1.6 var(--mono); white-space: pre-wrap; }
.rich a { color: var(--accent); }
.post-foot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; padding-bottom: 64px; }

.chart { min-width: 0; margin: 0; }
.chart svg { display: block; width: 100%; height: auto; }
.chart figcaption { color: var(--muted); margin-top: 8px; }
.chart text { font: 500 12px var(--mono); fill: var(--muted); }
.chart .label-after { fill: var(--accent); }
.chart .label-before { fill: var(--alert); }
.axis { stroke: var(--line); }
.budget { stroke: var(--ink); stroke-dasharray: 5 4; }
.series { fill: none; stroke-width: 2.5; stroke-linejoin: round; }
.series.before { stroke: var(--alert); }
.series.after { stroke: var(--accent); }

.write-form { display: grid; gap: 10px; padding-bottom: 64px; }
.write-row { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 10px; }
.field { width: 100%; min-width: 0; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 9px 12px; font: 400 16px/1.5 var(--body); border-radius: 0; }
.editor-box { border: 1px solid var(--line); background: var(--surface); min-width: 0; }
.toolbar { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px; border-bottom: 1px solid var(--line); }
.toolbar button { min-width: 34px; border: 0; background: none; color: var(--ink); padding: 3px 8px; font: 500 14px/1.5 var(--body); cursor: pointer; }
.toolbar button:hover { background: var(--bg); }
.toolbar .sep { width: 1px; margin: 4px 4px; background: var(--line); }
.editor { min-height: 340px; padding: 16px; line-height: 1.8; overflow-wrap: anywhere; }
#color-apply { box-shadow: inset 0 -3px 0 var(--pick, #ffffff); }
.toolbar input[type="color"] { width: 26px; height: 30px; padding: 2px; border: 0; background: none; cursor: pointer; }
.write-foot { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: flex-end; }
.write-status { color: var(--alert); font-size: 14px; margin-right: auto; }
.login { display: grid; gap: 14px; justify-items: start; max-width: 440px; margin-inline: auto; padding: clamp(20px, 4vw, 32px); background: var(--surface); border: 2px solid var(--ink); }
.login h1 { font-size: 32px; }
.section[data-view="admin"] { border-top: 0; }
.project-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 28px; align-items: start; }
.project-image { display: grid; gap: 10px; min-width: 0; }
.preview { display: flex; align-items: center; justify-content: center; aspect-ratio: 16 / 9; max-width: 100%; padding: 2px; border: 2px dashed var(--line); background: var(--surface); overflow: hidden; text-align: center; }
.preview img { display: block; width: 100%; height: 100%; object-fit: cover; }
.project-fields { display: grid; gap: 14px; min-width: 0; }
.label-field { display: grid; gap: 4px; min-width: 0; font-size: 14px; font-weight: 500; }
.field-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
textarea.field { min-height: 110px; resize: vertical; }
.row-actions a { color: var(--accent); text-decoration: none; margin-left: 10px; }
.row-actions a:first-child { margin-left: 0; }
.row-actions a:hover { text-decoration: underline; }
.row-actions a.danger { color: var(--alert); }
.row-actions .move { margin-right: 2px; padding: 0 6px; border: 1px solid var(--line); background: none; color: var(--ink); font: 12px/1.6 var(--body); cursor: pointer; }
.row-actions .move:hover:not(:disabled) { background: var(--bg); }
.row-actions .move:disabled { opacity: .3; cursor: default; }
.row-actions .move + a { margin-left: 8px; }

footer { border-top: 2px solid var(--ink); color: var(--muted); font-size: 13px; }
footer .wrap { padding-block: 24px; }
.visit-toggle { border: 0; background: none; padding: 0; color: inherit; font: inherit; cursor: pointer; }
.visit-toggle:hover { color: var(--ink); }
.visits { display: flex; flex-wrap: wrap; gap: 8px 32px; margin: 14px 0 0; }
.visits div { display: grid; gap: 2px; }
.visits dt { font-size: 13px; }
.visits dd { margin: 0; color: var(--ink); font: 500 22px/1.2 var(--mono); font-variant-numeric: tabular-nums; }
.visit-note { margin-top: 8px; }

@media (max-width: 760px) {
  .detail-head, .about, .project-grid, .field-pair { grid-template-columns: minmax(0, 1fr); }
  .stage { --w: 68%; --shift: 74%; aspect-ratio: 16 / 6.12; }
  .slide-arrow { width: 36px; height: 36px; margin-top: -18px; font-size: 16px; }
  #slide-prev { left: 4px; }
  #slide-next { right: 4px; }
  .write-row { grid-template-columns: minmax(0, 1fr); }
  .board, .board tbody, .board tr { display: block; }
  .board thead { display: none; }
  .board tr { padding: 10px 2px; border-bottom: 1px solid var(--line); }
  .board td { display: inline; padding: 0; border: 0; margin-right: 10px; }
  .board td.b-no { display: none; }
  .board td.b-title { display: block; margin: 0 0 3px; }
  .board td[data-label]::before { content: attr(data-label) " "; }
  .chart text { font-size: 18px; }
  .chart .budget-label { display: none; }
  .card { gap: 8px; }
  .card strong { font-size: 19px; }
  .card-text { font-size: 13px; }
  .card .mono { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .btn:hover:not(:disabled) { transform: none; }
  .slide { transition: none; }
}
.visit-admin { margin-top: 14px; }
