:root {
  --ink: #181713;
  --paper: #f3f0e7;
  --soft: #d8d0bd;
  --muted: #8d8779;
  --line: rgba(24, 23, 19, 0.14);
  --panel: #fffaf0;
  --red: #b9473f;
  --blue: #315e86;
  --green: #4f765a;
  --gold: #a6732a;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  letter-spacing: 0;
}

body.viewer-open {
  overflow: hidden;
}

a { color: inherit; }
button, input {
  font: inherit;
}

.site-header {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  color: var(--paper);
  mix-blend-mode: difference;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  font-family: serif;
}

.site-header nav {
  display: flex;
  gap: 20px;
  font-size: 13px;
}

.site-header a {
  text-decoration: none;
}

.hero {
  min-height: 92vh;
  position: relative;
  display: grid;
  align-items: end;
  padding: 120px 36px 44px;
  color: var(--paper);
  background-image:
    linear-gradient(90deg, rgba(0,0,0,.78), rgba(0,0,0,.24) 58%, rgba(0,0,0,.5)),
    var(--hero-image);
  background-size: cover;
  background-position: center;
}

.hero-inner {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) 360px;
  gap: 52px;
  align-items: end;
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 800;
  color: #f4c057;
}

h1 {
  margin: 0;
  max-width: 900px;
  font-size: clamp(46px, 8vw, 112px);
  line-height: .92;
  font-weight: 800;
}

.lead {
  max-width: 670px;
  margin: 24px 0 0;
  font-size: clamp(17px, 1.7vw, 24px);
  line-height: 1.55;
  color: rgba(243,240,231,.9);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid rgba(243,240,231,.42);
  background: rgba(0,0,0,.2);
  backdrop-filter: blur(8px);
}

.hero-stats div {
  padding: 18px;
  border-right: 1px solid rgba(243,240,231,.28);
}

.hero-stats div:last-child {
  border-right: 0;
}

.hero-stats span,
.hero-caption {
  display: block;
  font-size: 11px;
  color: rgba(243,240,231,.72);
}

.hero-stats b {
  display: block;
  margin-top: 8px;
  font: 500 36px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.hero-caption {
  grid-column: 1 / -1;
  margin-top: 12px;
  text-align: right;
}

main {
  overflow: hidden;
}

.section {
  padding: 84px 36px;
}

.section-inner {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 30px;
}

.section-title h2 {
  margin: 0;
  max-width: 720px;
  font-size: clamp(30px, 4vw, 58px);
  line-height: 1;
}

.section-title p {
  max-width: 360px;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.theme-rail {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border: 1px solid var(--line);
}

.theme {
  min-height: 116px;
  padding: 18px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.theme:last-child {
  border-right: 0;
}

.theme span {
  display: block;
  font-weight: 700;
}

.theme b {
  display: block;
  margin-top: 28px;
  font: 400 32px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--muted);
}

.theme.active {
  background: var(--ink);
  color: var(--paper);
}

.timeline {
  margin-top: 28px;
  min-height: 170px;
  display: grid;
  grid-template-columns: repeat(18, minmax(42px, 1fr));
  align-items: end;
  border-bottom: 1px solid var(--ink);
  overflow-x: auto;
}

.timeline article {
  min-width: 42px;
  display: grid;
  justify-items: center;
  gap: 8px;
}

.timeline span {
  width: 14px;
  background: var(--blue);
}

.timeline time,
.timeline b {
  font: 11px ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--muted);
}

.archive-section {
  background: #e1ded4;
}

.archive-tools {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.archive-tools input {
  width: min(520px, 100%);
  height: 46px;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 0 16px;
  outline: 0;
}

.archive-tools span {
  color: var(--muted);
}

.archive-layout {
  display: grid;
  grid-template-columns: minmax(320px, .92fr) minmax(420px, 1fr);
  gap: 28px;
  align-items: start;
}

.archive-list {
  max-height: 760px;
  overflow: auto;
  border-top: 1px solid var(--line);
}

.archive-card {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.archive-card h3 {
  margin: 10px 0;
  font-size: 20px;
  line-height: 1.32;
}

.archive-card p {
  margin: 0;
  color: #5f5a50;
  line-height: 1.55;
}

.archive-card.selected h3,
.archive-card:hover h3 {
  color: var(--red);
}

.card-meta,
.card-bottom {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  font-size: 12px;
  color: var(--muted);
}

.card-bottom {
  margin-top: 14px;
}

.record-detail {
  position: sticky;
  top: 88px;
  scroll-margin-top: 82px;
  min-height: 520px;
  padding: 34px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.record-detail h2 {
  margin: 0 0 22px;
  font-size: clamp(28px, 3vw, 46px);
  line-height: 1.08;
}

.record-preview {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  margin: 0 0 22px;
  aspect-ratio: 4 / 3;
  background: #d0c9ba;
  overflow: hidden;
}

.record-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.record-detail dl {
  margin: 0 0 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.record-detail dt {
  font-size: 11px;
  color: var(--muted);
}

.record-detail dd {
  margin: 4px 0 0;
  line-height: 1.45;
}

.record-detail > p:last-of-type {
  font-size: 17px;
  line-height: 1.75;
}

.record-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.record-links a {
  padding: 10px 13px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  font-size: 13px;
}

.record-links span {
  color: var(--muted);
  font-size: 13px;
}

.image-wall {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-flow: dense;
  gap: 10px;
}

.image-tile {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  margin: 0;
  aspect-ratio: 1;
  background: #d0c9ba;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
}

.image-tile.large {
  grid-column: span 2;
  grid-row: span 2;
}

.image-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}

.image-tile:hover img {
  transform: scale(1.04);
}

.image-tile figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 34px 12px 12px;
  color: white;
  background: linear-gradient(transparent, rgba(0,0,0,.72));
  opacity: 0;
  transition: opacity .25s ease;
}

.image-tile:hover figcaption {
  opacity: 1;
}

.image-tile b,
.image-tile span {
  display: block;
  font-size: 12px;
  line-height: 1.35;
}

.image-viewer {
  position: fixed;
  z-index: 60;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 32px 76px;
  background: rgba(12, 12, 10, .92);
  color: var(--paper);
}

.image-viewer[hidden] {
  display: none;
}

.image-viewer figure {
  width: min(1180px, 100%);
  max-height: 92vh;
  margin: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 18px;
}

.image-viewer img {
  max-width: 100%;
  max-height: calc(92vh - 86px);
  justify-self: center;
  align-self: center;
  object-fit: contain;
  box-shadow: 0 22px 80px rgba(0,0,0,.34);
}

.image-viewer figcaption {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
  font-size: 14px;
  line-height: 1.45;
}

.image-viewer figcaption b {
  max-width: 760px;
}

.image-viewer figcaption span {
  color: rgba(243,240,231,.68);
  white-space: nowrap;
}

.viewer-close,
.viewer-nav {
  position: absolute;
  border: 1px solid rgba(243,240,231,.38);
  background: rgba(0,0,0,.24);
  color: var(--paper);
  cursor: pointer;
}

.viewer-close {
  top: 22px;
  right: 22px;
  width: 44px;
  height: 44px;
  font-size: 30px;
  line-height: 1;
}

.viewer-nav {
  top: 50%;
  width: 48px;
  height: 72px;
  transform: translateY(-50%);
  font-size: 46px;
  line-height: 1;
}

.viewer-prev {
  left: 18px;
}

.viewer-next {
  right: 18px;
}

.log-section {
  background: #24231f;
  color: var(--paper);
}

.log-section .section-title p {
  color: rgba(243,240,231,.66);
}

.log-board {
  display: grid;
  grid-template-columns: minmax(280px, .72fr) minmax(0, 1.28fr);
  gap: 0;
  border: 1px solid rgba(243,240,231,.2);
  background: rgba(0,0,0,.18);
}

.log-list {
  display: grid;
  max-height: 560px;
  overflow: auto;
  border-right: 1px solid rgba(243,240,231,.16);
}

.log-card {
  min-height: 118px;
  padding: 18px;
  border: 0;
  border-bottom: 1px solid rgba(243,240,231,.13);
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.log-card:hover,
.log-card.active {
  background: #f3f0e7;
  color: var(--ink);
}

.log-card time {
  display: block;
  margin-bottom: 12px;
  color: #f4c057;
  font: 13px ui-monospace, SFMono-Regular, Menlo, monospace;
}

.log-card.active time,
.log-card:hover time {
  color: var(--red);
}

.log-card span {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  color: currentColor;
  opacity: .72;
}

.log-card b {
  display: block;
  font-size: 16px;
  line-height: 1.42;
}

.log-detail {
  min-height: 560px;
  padding: 38px;
  display: grid;
  align-content: center;
}

.log-detail h3 {
  margin: 0 0 26px;
  max-width: 760px;
  font-size: clamp(30px, 4vw, 58px);
  line-height: 1.04;
}

.log-detail ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 14px;
  max-width: 740px;
}

.log-detail li {
  padding-left: 18px;
  border-left: 3px solid #f4c057;
  color: rgba(243,240,231,.82);
  line-height: 1.65;
}

.site-footer {
  padding: 28px 36px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.error {
  padding: 24px;
  color: var(--red);
}

@media (max-width: 980px) {
  .site-header {
    position: absolute;
    padding: 0 18px;
  }
  .site-header nav {
    display: none;
  }
  .hero {
    min-height: 88vh;
    padding: 96px 20px 28px;
  }
  .hero-inner,
  .archive-layout {
    grid-template-columns: 1fr;
  }
  .hero-stats,
  .theme-rail,
  .log-list {
    grid-template-columns: 1fr 1fr;
  }
  .log-board {
    grid-template-columns: 1fr;
  }
  .log-list {
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid rgba(243,240,231,.16);
  }
  .log-card {
    min-height: 128px;
  }
  .log-detail {
    min-height: 0;
    padding: 28px 22px;
  }
  .log-detail h3 {
    font-size: 30px;
  }
  .section {
    padding: 62px 20px;
  }
  .section-title {
    display: block;
  }
  .section-title p {
    margin-top: 14px;
  }
  .image-wall {
    grid-template-columns: repeat(2, 1fr);
  }
  .image-viewer {
    padding: 72px 18px 26px;
  }
  .image-viewer img {
    max-height: calc(86vh - 112px);
  }
  .image-viewer figcaption {
    display: block;
    font-size: 13px;
  }
  .image-viewer figcaption span {
    display: block;
    margin-top: 6px;
    white-space: normal;
  }
  .viewer-close {
    top: 14px;
    right: 14px;
  }
  .viewer-nav {
    top: auto;
    bottom: 18px;
    width: 56px;
    height: 44px;
    transform: none;
    font-size: 34px;
  }
  .viewer-prev {
    left: 18px;
  }
  .viewer-next {
    right: 18px;
  }
  .record-detail {
    position: static;
    order: -1;
    min-height: 0;
    padding: 24px;
  }
  .record-detail dl {
    grid-template-columns: 1fr;
  }
  .site-footer {
    display: block;
  }
}
