:root {
  --ink: #14213d;
  --ink-soft: #3c4a6b;
  --paper: #f1ede0;
  --paper-raised: #fbf9f2;
  --brass: #a8762c;
  --brass-strong: #8c5f1f;
  --stamp: #a63a2c;
  --stamp-soft: rgba(166, 58, 44, 0.1);
  --brass-soft: rgba(168, 118, 44, 0.12);
  --line: rgba(20, 33, 61, 0.18);
  --line-strong: rgba(20, 33, 61, 0.34);
  --shadow: rgba(20, 33, 61, 0.14);
  --focus: #2f6fb0;
  --radius-lg: 16px;
  --radius: 12px;
  --radius-sm: 9px;
  --radius-pill: 999px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #ece6d4;
    --ink-soft: #b7b0a0;
    --paper: #10182a;
    --paper-raised: #1a2340;
    --brass: #d9a94f;
    --brass-strong: #eec06b;
    --stamp: #e07059;
    --stamp-soft: rgba(224, 112, 89, 0.16);
    --brass-soft: rgba(217, 169, 79, 0.14);
    --line: rgba(236, 230, 212, 0.16);
    --line-strong: rgba(236, 230, 212, 0.3);
    --shadow: rgba(0, 0, 0, 0.45);
    --focus: #7db3e8;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, "Apple SD Gothic Neo", "Pretendard", system-ui, "Segoe UI", sans-serif;
  line-height: 1.5;
}

.wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

header.cover {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--paper-raised);
  padding: 30px 28px;
  position: relative;
  box-shadow: 0 1px 0 var(--line), 0 16px 40px -20px var(--shadow);
}

header.cover::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius-lg) - 6px);
  pointer-events: none;
}

.eyebrow {
  font-family: ui-monospace, "SF Mono", "Roboto Mono", Consolas, monospace;
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--brass-strong);
  display: flex;
  align-items: center;
  gap: 10px;
}

.eyebrow .rule { flex: 1; height: 1px; background: var(--line-strong); }

h1 {
  font-family: ui-serif, Georgia, "Noto Serif KR", "Times New Roman", serif;
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: 0.01em;
  margin: 12px 0 4px;
  text-wrap: balance;
}

h1 .en {
  display: block;
  font-family: ui-monospace, "SF Mono", "Roboto Mono", Consolas, monospace;
  font-size: 13px;
  letter-spacing: 0.3em;
  color: var(--ink-soft);
  text-transform: uppercase;
  margin-top: 8px;
}

.lede {
  max-width: 68ch;
  color: var(--ink-soft);
  font-size: 14.5px;
  margin: 14px 0 18px;
}

.meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 26px;
  font-family: ui-monospace, "SF Mono", "Roboto Mono", Consolas, monospace;
  font-size: 12px;
  color: var(--ink-soft);
  border-top: 1px dashed var(--line-strong);
  padding-top: 14px;
}

.meta-strip b { color: var(--ink); font-weight: 600; }

.desk {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px 30px;
  align-items: baseline;
}

/* ---------- Search bar ---------- */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--paper-raised);
  padding: 12px 20px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-bar:focus-within {
  border-color: var(--brass);
  box-shadow: 0 0 0 3px var(--brass-soft);
}

.search-icon {
  font-size: 16px;
  color: var(--brass-strong);
  flex: 0 0 auto;
}

#search-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-family: ui-monospace, "SF Mono", "Roboto Mono", Consolas, monospace;
  font-size: 14px;
  color: var(--ink);
}

#search-input::placeholder { color: var(--ink-soft); }

#search-clear {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: var(--line);
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

#search-clear:hover { color: var(--stamp); }

.filter-group { display: flex; flex-direction: column; gap: 8px; }

.filter-group .label {
  font-family: ui-monospace, "SF Mono", "Roboto Mono", Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brass-strong);
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  font-family: ui-monospace, "SF Mono", "Roboto Mono", Consolas, monospace;
  font-size: 13px;
  padding: 7px 15px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: all 0.15s ease;
}

.chip:hover { border-color: var(--brass); color: var(--ink); background: var(--brass-soft); }

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

.chip:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* ---------- Split layout: list + map ---------- */
.layout {
  margin-top: 24px;
  display: grid;
  grid-template-columns: minmax(340px, 460px) 1fr;
  gap: 20px;
  align-items: start;
}

.list-panel { min-width: 0; }

.count-line {
  font-family: ui-monospace, "SF Mono", "Roboto Mono", Consolas, monospace;
  font-size: 12px;
  color: var(--ink-soft);
  margin: 0 2px 14px;
}

.count-line b { color: var(--ink); }

.grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 74vh;
  overflow-y: auto;
  padding-right: 4px;
}

.map-panel {
  position: sticky;
  top: 20px;
  height: 74vh;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: 0 10px 24px -18px var(--shadow);
  overflow: hidden;
  background: var(--paper-raised);
}

#map {
  width: 100%;
  height: 100%;
}

.map-fallback {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.7;
}

.map-fallback code {
  background: var(--paper);
  padding: 2px 6px;
  border: 1px solid var(--line-strong);
  font-size: 12px;
}

.pass {
  display: flex;
  background: var(--paper-raised);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: 0 10px 24px -18px var(--shadow);
  position: relative;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.pass:hover, .pass.is-active {
  border-color: var(--brass);
  transform: translateY(-2px);
  box-shadow: 0 16px 30px -16px var(--shadow);
}

.stub {
  flex: 0 0 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 6px;
  border-right: 1px dashed var(--line-strong);
  position: relative;
}

.stub .code {
  font-family: ui-monospace, "SF Mono", "Roboto Mono", Consolas, monospace;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.04em;
  writing-mode: vertical-rl;
  color: var(--ink);
}

.stub .plane {
  font-size: 12px;
  color: var(--brass);
  writing-mode: vertical-rl;
  letter-spacing: 4px;
}

.stub::before, .stub::after {
  content: "";
  position: absolute;
  right: -6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--line-strong);
}
.stub::before { top: 8px; }
.stub::after { bottom: 8px; }

.pass-main {
  flex: 1;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.pass-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.name {
  font-family: ui-serif, Georgia, "Noto Serif KR", serif;
  font-size: 17px;
  line-height: 1.3;
  text-wrap: balance;
}

.name .orig {
  display: block;
  font-family: ui-monospace, "SF Mono", "Roboto Mono", Consolas, monospace;
  font-size: 10.5px;
  color: var(--ink-soft);
  margin-top: 2px;
  letter-spacing: 0.02em;
}

.category {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--stamp);
  background: var(--stamp-soft);
  border-radius: var(--radius-pill);
  padding: 4px 11px;
  white-space: nowrap;
}

.addr { font-size: 12px; color: var(--ink-soft); }

.addr-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
}

.maps-link {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--brass-strong);
  text-decoration: none;
  white-space: nowrap;
}

.maps-link:hover { color: var(--stamp); text-decoration: underline; }

.note {
  font-size: 12.5px;
  color: var(--ink);
  border-left: 2px solid var(--brass);
  padding-left: 9px;
}

.pass-bottom {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px dashed var(--line-strong);
  padding-top: 9px;
  gap: 10px;
}

.channel-badge {
  font-family: ui-monospace, "SF Mono", "Roboto Mono", Consolas, monospace;
  font-size: 11px;
  color: var(--ink-soft);
  white-space: nowrap;
  flex-shrink: 0;
}

.channel-badge b { color: var(--ink); font-weight: 700; }

.gate-link {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--brass-strong);
  text-decoration: none;
  background: var(--brass-soft);
  border-radius: var(--radius-pill);
  padding: 5px 12px;
  white-space: nowrap;
  flex: 0 0 auto;
  transition: background 0.15s ease, color 0.15s ease;
}

.gate-link:hover { color: var(--paper-raised); background: var(--brass-strong); }

.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--ink-soft);
  font-size: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}

footer {
  margin-top: 30px;
  border-top: 1px solid var(--line-strong);
  padding-top: 16px;
  font-size: 12px;
  color: var(--ink-soft);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
}

footer a { color: var(--ink-soft); }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .map-panel { position: static; height: 50vh; order: -1; }
  .grid { max-height: none; overflow-y: visible; }
}

@media (max-width: 480px) {
  .wrap { padding: 20px 14px 50px; }
  header.cover { padding: 22px 16px; }
  .stub { flex-basis: 58px; }
  .stub .code { font-size: 17px; }
  .topbar-inner { gap: 16px; padding: 0 14px; }
  .brand span { display: none; }
  .tab { padding: 0 10px; font-size: 12px; }
}

/* ---------- Top navbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--paper-raised);
  border-bottom: 1px solid var(--line-strong);
  box-shadow: 0 1px 0 var(--line);
}

.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 32px;
  overflow-x: auto;
}

.brand {
  font-family: ui-serif, Georgia, "Noto Serif KR", serif;
  font-size: 17px;
  color: var(--ink);
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
}

.brand-icon {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
}

.topbar-tabs {
  display: flex;
  gap: 4px;
  height: 100%;
}

.tab {
  font-family: ui-monospace, "SF Mono", "Roboto Mono", Consolas, monospace;
  font-size: 13px;
  letter-spacing: 0.04em;
  padding: 0 14px;
  height: 100%;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  white-space: nowrap;
  flex: 0 0 auto;
  color: var(--ink-soft);
  cursor: pointer;
}

.tab:hover { color: var(--ink); }

.tab.active {
  color: var(--ink);
  border-bottom-color: var(--brass);
}

.view[hidden] { display: none; }

.view { margin-top: 28px; }

#view-home .view { margin-top: 0; }

/* ---------- Home hero ---------- */
.tagline {
  font-size: clamp(34px, 5.4vw, 52px);
  line-height: 1.18;
}

.cta {
  margin-top: 22px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 14px 26px;
  border-radius: var(--radius-pill);
  background: var(--brass-strong);
  color: var(--paper-raised);
  border: 1px solid var(--brass-strong);
  cursor: pointer;
  box-shadow: 0 10px 24px -12px var(--brass-soft);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.cta:hover {
  background: var(--brass);
  transform: translateY(-2px);
  box-shadow: 0 14px 28px -12px var(--brass-soft);
}

.teaser-grid { margin-top: 14px; }

/* ---------- Channel view ---------- */
.channel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

.channel-card {
  background: var(--paper-raised);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: 0 10px 24px -18px var(--shadow);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.channel-card:hover {
  border-color: var(--brass);
  transform: translateY(-2px);
  box-shadow: 0 16px 30px -16px var(--shadow);
}

.channel-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.channel-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  object-fit: cover;
  flex: 0 0 auto;
}

.channel-name-block { min-width: 0; }

.channel-name {
  font-family: ui-serif, Georgia, "Noto Serif KR", serif;
  font-size: 19px;
}

.channel-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--brass-strong);
  background: var(--brass-soft);
  border-radius: var(--radius-pill);
  padding: 2px 10px;
  margin-top: 3px;
}

.channel-bio {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.6;
}

.channel-stats {
  display: flex;
  gap: 18px;
  font-family: ui-monospace, "SF Mono", "Roboto Mono", Consolas, monospace;
  font-size: 12px;
  border-top: 1px dashed var(--line-strong);
  padding-top: 12px;
}

.channel-stats b { color: var(--ink); display: block; font-size: 16px; }

.channel-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.channel-actions button, .channel-actions a {
  flex: 1;
  text-align: center;
  font-size: 12.5px;
  font-weight: 600;
  padding: 9px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.channel-actions button[data-channel] {
  background: var(--brass-strong);
  color: var(--paper-raised);
}

.channel-actions button[data-channel]:hover { background: var(--brass); }

.channel-actions a {
  border-color: var(--line-strong);
  color: var(--ink);
  background: transparent;
}

.channel-actions a:hover { border-color: var(--brass); color: var(--brass-strong); background: var(--brass-soft); }

/* ---------- Video view ---------- */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.video-card {
  background: var(--paper-raised);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: 0 10px 24px -18px var(--shadow);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.video-card:hover {
  border-color: var(--brass);
  transform: translateY(-2px);
  box-shadow: 0 16px 30px -16px var(--shadow);
}

.video-thumb-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--paper);
  overflow: hidden;
  border-radius: var(--radius) var(--radius) 0 0;
}

.video-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.video-play-badge {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  color: #fff;
  background: rgba(20, 33, 61, 0.15);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.video-card:hover .video-play-badge { opacity: 1; }

.video-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.video-title {
  font-size: 13.5px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: ui-monospace, "SF Mono", "Roboto Mono", Consolas, monospace;
  font-size: 11px;
  color: var(--ink-soft);
}

.video-restaurants {
  font-size: 11.5px;
  color: var(--ink-soft);
  border-top: 1px dashed var(--line-strong);
  padding-top: 8px;
}

.video-restaurants b { color: var(--ink); }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 26, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.modal-overlay[hidden] { display: none; }

.modal {
  background: var(--paper-raised);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  max-width: 640px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.5);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--paper-raised);
  color: var(--ink);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  transition: all 0.15s ease;
}

.modal-close:hover { border-color: var(--stamp); color: var(--paper-raised); background: var(--stamp); }

.modal-video {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
}

.modal-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.modal-info {
  padding: 20px 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-info .name {
  font-size: 22px;
}

.copy-link {
  align-self: flex-start;
  margin-top: 4px;
  font-size: 12.5px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.15s ease;
}

.copy-link:hover { border-color: var(--brass); color: var(--brass-strong); background: var(--brass-soft); }

@media (max-width: 480px) {
  .channel-grid, .video-grid { grid-template-columns: 1fr; }
}
