@charset "utf-8";

/* ==========================================================================
   만국진량 (萬國津梁)
   해도의 잉크를 배경으로, 양피지색을 글자로 뒤집은 밤바다 해도 스킨.
   강조는 항해기구의 황동, 부강조는 청동에 낀 녹청.
   표기 규칙: 본문·주석 전부 엠대시 금지.
   ========================================================================== */

:root {
  --ink-deep: #0a1622;
  --ink: #0f2130;
  --ink-raise: #14293a;
  --ink-sunk: #071019;

  --rule: #23404f;
  --rule-soft: #1a3040;

  --parchment: #e9ddc6;
  --parchment-dim: #a49a86;
  --parchment-faint: #948d7d;

  --brass: #c9a227;
  --brass-dim: #8a7124;
  --verdigris: #5fa8a0;

  --accent: var(--brass);

  --font-display: "Gowun Batang", "Nanum Myeongjo", serif;
  --font-latin: "Cormorant Garamond", "Gowun Batang", serif;
  --font-body: "IBM Plex Sans KR", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --measure: 1080px;
  --gutter: clamp(20px, 5vw, 56px);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background-color: var(--ink-deep);
  background-image:
    radial-gradient(ellipse 120% 80% at 50% -10%, rgba(95, 168, 160, 0.10), transparent 60%),
    radial-gradient(ellipse 90% 60% at 50% 110%, rgba(201, 162, 39, 0.07), transparent 60%);
  background-attachment: fixed;
  color: var(--parchment);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.85;
  letter-spacing: 0.01em;
}

img { max-width: 100%; display: block; }

a { color: inherit; }

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

.wrap {
  width: 100%;
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* --- 표제 ---------------------------------------------------------------- */

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 0;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--parchment-faint);
  margin: 0 0 14px;
}

.latin {
  font-family: var(--font-latin);
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0.14em;
  color: var(--parchment-dim);
}

.skip {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%, -140%);
  z-index: 60;
  background: var(--brass);
  color: var(--ink-deep);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  padding: 11px 20px;
  border-radius: 0 0 2px 2px;
  text-decoration: none;
  transition: transform 0.18s;
}

.skip:focus { transform: translate(-50%, 0); }

/* --- 상단 바 ------------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(7, 16, 25, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule-soft);
}

.topbar__inner {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 58px;
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.topbar__home {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.topbar__home:hover { color: var(--brass); }

.topbar__seas {
  display: flex;
  gap: 2px;
  margin-inline-start: auto;
  overflow-x: auto;
  scrollbar-width: none;
}

.topbar__seas::-webkit-scrollbar { display: none; }

.topbar__sea {
  font-size: 13px;
  text-decoration: none;
  color: var(--parchment-dim);
  padding: 6px 11px;
  border-radius: 2px;
  white-space: nowrap;
  transition: color 0.18s, background-color 0.18s;
}

.topbar__sea:hover { color: var(--parchment); background: rgba(255, 255, 255, 0.05); }

.topbar__sea[aria-current="page"] {
  color: var(--accent);
  box-shadow: inset 0 -1px 0 var(--accent);
}

.audio-toggle {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--parchment-dim);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  padding: 7px 11px;
  border-radius: 2px;
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s;
}

.audio-toggle:hover { color: var(--brass); border-color: var(--brass-dim); }

.audio-toggle__wave {
  width: 13px; height: 11px;
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
}

.audio-toggle__wave i {
  width: 2px;
  background: currentColor;
  height: 30%;
  animation: bar 1.1s ease-in-out infinite;
}

.audio-toggle__wave i:nth-child(2) { height: 100%; animation-delay: 0.16s; }
.audio-toggle__wave i:nth-child(3) { height: 60%; animation-delay: 0.32s; }

@keyframes bar {
  0%, 100% { transform: scaleY(0.4); }
  50% { transform: scaleY(1); }
}

.audio-toggle[data-playing="false"] .audio-toggle__wave i { animation-play-state: paused; transform: scaleY(0.3); }

/* --- 히어로 -------------------------------------------------------------- */

.hero { padding-block: clamp(56px, 10vw, 104px) 8px; text-align: center; }

.hero__mark {
  font-family: var(--font-display);
  font-size: clamp(40px, 9vw, 76px);
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  color: var(--brass);
  line-height: 1;
  margin: 0 0 22px;
}

.hero__title {
  font-size: clamp(30px, 5.4vw, 52px);
  letter-spacing: 0.02em;
  margin-bottom: 16px;
}

.hero__lede {
  max-width: 34em;
  margin: 0 auto;
  color: var(--parchment-dim);
  font-size: clamp(15px, 1.6vw, 17px);
}

/* --- 해도 ---------------------------------------------------------------- */

.seamap { padding-block: 8px clamp(28px, 5vw, 48px); }

.seamap__figure { margin: 0; }

.seamap__svg {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--rule-soft);
  border-radius: 2px;
}

.map-sea { fill: #0b1c2a; }
.map-land { fill: rgba(233, 221, 198, 0.09); stroke: rgba(201, 162, 39, 0.55); stroke-width: 0.9; stroke-linejoin: round; }
.map-grat { stroke: rgba(233, 221, 198, 0.07); stroke-width: 1; }
.map-grat--equator { stroke: rgba(201, 162, 39, 0.24); }
.map-edge { fill: none; stroke: rgba(201, 162, 39, 0.3); stroke-width: 1; }

.ray { cursor: pointer; }

.ray__halo {
  fill: var(--ray);
  opacity: 0.14;
  transition: opacity 0.25s;
}

.ray__node {
  fill: var(--ink-deep);
  stroke: var(--ray);
  stroke-width: 2;
  transition: fill 0.25s;
}

.ray__sea {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  fill: var(--parchment);
  paint-order: stroke;
  stroke: rgba(9, 22, 33, 0.85);
  stroke-width: 4;
  stroke-linejoin: round;
  transition: fill 0.25s;
}

.ray__area {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  fill: var(--parchment-dim);
  paint-order: stroke;
  stroke: rgba(9, 22, 33, 0.85);
  stroke-width: 3.5;
  stroke-linejoin: round;
  transition: fill 0.25s;
}

.ray:hover .ray__halo,
.ray:focus-visible .ray__halo { opacity: 0.34; }
.ray:hover .ray__node,
.ray:focus-visible .ray__node { fill: var(--ray); }
.ray:hover .ray__sea,
.ray:focus-visible .ray__sea { fill: var(--ray); }

.searoutes {
  display: none;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--rule-soft);
}

.searoutes__item { border-bottom: 1px solid var(--rule-soft); }

.searoutes__link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 4px;
  text-decoration: none;
}

.searoutes__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ray);
  flex: none;
}

.searoutes__sea {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
}

.searoutes__link:hover .searoutes__sea { color: var(--ray); }

.seamap__caption {
  margin: 12px auto 0;
  max-width: 40em;
  text-align: center;
  font-size: 13px;
  color: var(--parchment-faint);
}

/* --- 일반 섹션 ----------------------------------------------------------- */

.section { padding-block: clamp(44px, 7vw, 86px); border-top: 1px solid var(--rule-soft); }

.section__head { margin-bottom: 32px; }

.section__title { font-size: clamp(22px, 3vw, 30px); }

.section__note { color: var(--parchment-dim); max-width: 44em; margin: 12px 0 0; }

.prose p { margin: 0 0 1.15em; max-width: 42em; }
.prose--wide p { max-width: 52em; }
.prose p:last-child { margin-bottom: 0; }

.columns {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}

/* --- 세력 표 ------------------------------------------------------------- */

.powers { margin: 0; }

.powers__row {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(0, 1.4fr);
  gap: 6px 20px;
  padding: 13px 0;
  border-top: 1px solid var(--rule-soft);
}

.powers__row:last-child { border-bottom: 1px solid var(--rule-soft); }

.powers__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  margin: 0;
  color: var(--parchment);
}

.powers__desc { margin: 0; font-size: 14px; color: var(--parchment-dim); line-height: 1.7; }

/* --- 해역 표제 ----------------------------------------------------------- */

.seahead { padding-block: clamp(44px, 8vw, 84px) 0; }

.seahead__bar { height: 2px; background: var(--accent); width: 64px; margin-bottom: 26px; }

.seahead__title { font-size: clamp(34px, 6.4vw, 62px); letter-spacing: 0.01em; }

.seahead__latin { display: block; font-size: clamp(13px, 1.6vw, 15px); margin-top: 12px; }

.seahead__tagline {
  margin: 22px 0 0;
  font-family: var(--font-display);
  font-size: clamp(17px, 2.2vw, 21px);
  color: var(--accent);
  max-width: 30em;
}

/* 해도 눈금을 닮은 상단 눈금선. 이 사이트의 유일한 장식 장치다 */
.card, .detail, .seanav__link { position: relative; }

/* sticky 상단바에 가리지 않도록 하는 스크롤 여백. 모바일은 두 줄이라 더 크다 */
.card, .detail { scroll-margin-top: 76px; }

.card::before,
.detail::before,
.seanav__link::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    to right,
    rgba(201, 162, 39, 0.34) 0 1px,
    transparent 1px 9px
  );
  opacity: 0.5;
  transition: opacity 0.22s;
}

.card:hover::before,
.card[aria-expanded="true"]::before,
.detail::before,
.seanav__link:hover::before { opacity: 1; }

/* --- 인물 격자 ----------------------------------------------------------- */

.roster {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 20px;
}

.card {
  position: relative;
  display: block;
  width: 100%;
  text-align: start;
  padding: 0;
  background: var(--ink);
  border: 1px solid var(--rule-soft);
  border-radius: 2px;
  color: inherit;
  font: inherit;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.22s, transform 0.22s, background-color 0.22s;
}

.card:hover { border-color: var(--accent); transform: translateY(-3px); }

.card[aria-expanded="true"] { border-color: var(--accent); background: var(--ink-raise); }

.card__frame {
  display: block;
  position: relative;
  aspect-ratio: 1280 / 753;
  background: var(--ink-sunk);
  overflow: hidden;
}

.card__img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center;
  filter: saturate(0.92) contrast(1.03);
  transition: filter 0.3s, transform 0.4s;
}

.card:hover .card__img { filter: saturate(1) contrast(1.03); transform: scale(1.03); }

.card__fallback {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.04em;
  color: var(--parchment-dim);
  background: var(--ink-sunk);
}


.card__male {
  position: absolute;
  top: 9px; left: 9px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--ink-deep);
  background: var(--brass);
  padding: 3px 6px;
  border-radius: 2px;
}

.card__body { display: block; padding: 13px 14px 15px; }

.card__epithet {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--accent);
  margin: 0 0 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card__name { display: block; font-family: var(--font-display); font-weight: 700; font-size: 17px; margin: 0; }

.card__role { display: block; margin: 6px 0 0; font-size: 12px; color: var(--parchment-faint); line-height: 1.55; }

.card__more {
  display: block;
  margin: 10px 0 0;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--parchment-faint);
}

.card[aria-expanded="true"] .card__more { color: var(--accent); }

/* --- 인물 상세 ----------------------------------------------------------- */

.detail {
  grid-column: 1 / -1;
  background: var(--ink);
  border: 1px solid var(--accent);
  border-radius: 2px;
  padding: 0;
  overflow: hidden;
}

.detail__frame {
  display: block;
  position: relative;
  aspect-ratio: 1280 / 753;
  background: var(--ink-sunk);
  border-bottom: 1px solid var(--accent);
  overflow: hidden;
}

.detail__card {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 1280 / 753;
  object-fit: cover;
}

.detail__inner { padding: clamp(24px, 4vw, 40px); }

.detail[hidden] { display: none; }

.detail__top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--rule-soft);
}


.detail__name { font-size: clamp(22px, 3.2vw, 30px); }

.detail__epithet { font-family: var(--font-display); color: var(--parchment-dim); font-size: 15px; }

.detail__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(24px, 4vw, 48px);
  padding-top: 24px;
}

.spec { margin: 0; }

.spec__row {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid var(--rule-soft);
}

.spec__key {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--parchment-faint);
  margin: 0;
  padding-top: 4px;
}

.spec__val { margin: 0; font-size: 14px; line-height: 1.7; }

.detail__story { margin: 0 0 24px; font-size: 15px; }

.quotes { margin: 0; padding: 0; }

.quotes__label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  color: var(--parchment-faint);
  margin: 0 0 12px;
}

.quote {
  margin: 0 0 12px;
  padding: 0 0 0 16px;
  border-left: 1px solid var(--accent);
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 1.75;
  color: var(--parchment);
}

.quote:last-child { margin-bottom: 0; }

.detail__close {
  margin-top: 26px;
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--parchment-dim);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  padding: 9px 16px;
  border-radius: 2px;
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s;
}

.detail__close:hover { color: var(--accent); border-color: var(--accent); }

/* --- 해역 이동 ----------------------------------------------------------- */

.seanav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  padding-block: clamp(36px, 6vw, 64px) clamp(48px, 8vw, 90px);
  border-top: 1px solid var(--rule-soft);
}

.seanav__link {
  display: block;
  text-decoration: none;
  padding: 20px 22px;
  border: 1px solid var(--rule-soft);
  border-radius: 2px;
  transition: border-color 0.2s, background-color 0.2s;
}

.seanav__link:hover { border-color: var(--jump); background: rgba(255, 255, 255, 0.03); }

.seanav__dir {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--parchment-faint);
  margin: 0 0 8px;
}

.seanav__sea { font-family: var(--font-display); font-weight: 700; font-size: 19px; margin: 0; }
.seanav__link:hover .seanav__sea { color: var(--jump); }
.seanav__tag { margin: 6px 0 0; font-size: 13px; color: var(--parchment-dim); }

/* --- 명단 스트립 --------------------------------------------------------- */

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

.strip__item {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--parchment-dim);
  border: 1px solid var(--rule-soft);
  border-radius: 2px;
  padding: 5px 9px;
  text-decoration: none;
  transition: color 0.18s, border-color 0.18s;
}

.strip__item:hover { color: var(--sea); border-color: var(--sea); }


/* --- 음악 ---------------------------------------------------------------- */

.topbar__music {
  flex: none;
  font-size: 13px;
  text-decoration: none;
  color: var(--parchment-dim);
  padding: 6px 11px;
  border-radius: 2px;
  white-space: nowrap;
  transition: color 0.18s, background-color 0.18s;
}

.topbar__music:hover { color: var(--brass); background: rgba(255, 255, 255, 0.05); }

.topbar__music[aria-current="page"] {
  color: var(--brass);
  box-shadow: inset 0 -1px 0 var(--brass);
}

.tracks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  gap: 18px;
}

.track {
  position: relative;
  min-width: 0;
  background: var(--ink);
  border: 1px solid var(--rule-soft);
  border-radius: 2px;
  padding: 24px 22px 20px;
  transition: border-color 0.22s;
}

.track::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    to right,
    rgba(201, 162, 39, 0.34) 0 1px,
    transparent 1px 9px
  );
  opacity: 0.5;
  transition: opacity 0.22s;
}

.track:hover { border-color: var(--accent); }
.track:hover::before { opacity: 1; }

.track__head { margin-bottom: 16px; }

.track__sub {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--accent);
  margin: 0 0 6px;
}

.track__title { font-size: 21px; }

.track__spec {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  margin: 0 0 14px;
  padding: 12px 0;
  border-top: 1px solid var(--rule-soft);
  border-bottom: 1px solid var(--rule-soft);
}

.track__spec div { display: flex; align-items: baseline; gap: 8px; }

.track__spec dt {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--parchment-faint);
}

.track__spec dd { margin: 0; font-size: 13px; }

.track__note { margin: 0 0 18px; font-size: 14px; color: var(--parchment-dim); }

.track__player {
  width: 100%;
  height: 38px;
  margin-bottom: 14px;
  filter: invert(0.88) hue-rotate(180deg) saturate(0.4);
}

.track__get {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--accent);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 12px 14px;
  transition: border-color 0.18s, background-color 0.18s;
}

.track__get:hover { border-color: var(--accent); background: rgba(255, 255, 255, 0.04); }

.track__size {
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--parchment-faint);
}

/* --- 푸터 ---------------------------------------------------------------- */

.foot {
  border-top: 1px solid var(--rule-soft);
  padding-block: 34px 54px;
  font-size: 12px;
  color: var(--parchment-faint);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  align-items: baseline;
}

.foot__mono { font-family: var(--font-mono); letter-spacing: 0.16em; }

/* --- 반응형 -------------------------------------------------------------- */

@media (max-width: 860px) {
  .columns { grid-template-columns: 1fr; }
  .detail__grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .seamap__figure {
    overflow-x: auto;
    overscroll-behavior-x: contain;
    border: 1px solid var(--rule-soft);
    border-radius: 2px;
  }
  .seamap__svg { min-width: 760px; border: 0; border-radius: 0; }
  .seamap__caption { font-size: 12px; }
  .searoutes { display: block; }
  .topbar__inner { flex-wrap: wrap; padding-block: 8px; row-gap: 4px; }
  .topbar__seas {
    order: 3;
    width: 100%;
    margin-inline-start: 0;
    padding-bottom: 2px;
  }
  .audio-toggle { margin-inline-start: auto; }
  .roster { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
  .card, .detail { scroll-margin-top: 108px; }
  .tracks { grid-template-columns: minmax(0, 1fr); }
  .card__body { padding: 11px 12px 13px; }
  .card__name { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .card:hover { transform: none; }
  .card:hover .card__img { transform: none; }
}
