:root {
  color-scheme: light;
  --ink: #151927;
  --muted: #697187;
  --paper: #f7f7fb;
  --surface: rgba(255, 255, 255, 0.92);
  --line: rgba(41, 48, 70, 0.11);
  --night: #080b14;
  --night-soft: #12182a;
  --violet: #8c7bff;
  --cyan: #69d8e7;
  --pink: #ff8ab5;
  --gold: #f1c873;
  --shadow: 0 22px 55px rgba(18, 23, 42, 0.1);
}

html {
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  background: var(--night);
}

.hero-world-doc {
  background:
    radial-gradient(circle at 8% 8%, rgba(140, 123, 255, 0.12), transparent 24rem),
    var(--paper) !important;
  color: var(--ink) !important;
  font-family: "Pretendard", "SUIT", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif !important;
  line-height: 1.6 !important;
}

.hero-world-doc .page {
  overflow: clip;
  background: transparent !important;
  padding-bottom: 88px;
}

.hero-world-doc .shell {
  width: min(1180px, calc(100% - 48px));
}

.hero-world-doc .document-header {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 84px 0 32px;
  border: 0;
  color: #f8f9ff;
  background:
    radial-gradient(circle at 82% 18%, rgba(105, 216, 231, 0.2), transparent 22rem),
    radial-gradient(circle at 17% 0%, rgba(140, 123, 255, 0.32), transparent 30rem),
    linear-gradient(135deg, #080b14 0%, #11172a 52%, #17132b 100%);
}

.hero-world-doc .document-header::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  opacity: 0.16;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black, transparent 86%);
}

.hero-world-doc .document-header::after {
  content: "HERO\A ARCHIVE";
  position: absolute;
  z-index: -1;
  right: -0.04em;
  top: -0.22em;
  white-space: pre;
  color: rgba(255, 255, 255, 0.025);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(120px, 19vw, 290px);
  font-weight: 900;
  line-height: 0.72;
  letter-spacing: -0.08em;
  text-align: right;
  pointer-events: none;
}

.hero-world-doc .header-row {
  align-items: flex-end;
  gap: 44px;
}

.hero-world-doc .title-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero-world-doc .title-label::before {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
}

.hero-world-doc .document-header h1 {
  margin: 0;
  max-width: 720px;
  color: #fff;
  font-size: clamp(44px, 6.5vw, 76px);
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: -0.07em;
  text-wrap: balance;
}

.hero-world-doc .document-header h1::after {
  content: ".";
  color: var(--violet);
}

.hero-world-doc .document-header p:not(.title-label) {
  max-width: 690px;
  margin-top: 24px;
  color: rgba(232, 236, 250, 0.72);
  font-size: 15px;
  line-height: 1.8;
}

.hero-world-doc .header-side {
  min-width: 300px;
  gap: 16px;
}

.hero-world-doc .preview-link,
.hero-world-doc .top-preview-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, rgba(140, 123, 255, 0.92), rgba(118, 83, 205, 0.94));
  box-shadow: 0 12px 28px rgba(79, 60, 170, 0.34);
  font-size: 12px;
  font-weight: 800;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hero-world-doc .preview-link:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #9a8cff, #795ad7);
  box-shadow: 0 16px 32px rgba(79, 60, 170, 0.42);
}

.hero-world-doc .doc-stats {
  width: 100%;
  gap: 8px;
}

.hero-world-doc .doc-stats span {
  flex: 1;
  min-width: 82px;
  padding: 14px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  color: rgba(225, 231, 247, 0.62);
  background: rgba(255, 255, 255, 0.055);
  backdrop-filter: blur(12px);
}

.hero-world-doc .doc-stats b {
  color: #fff;
  font-size: 24px;
  line-height: 1;
}

.hero-world-doc .nav {
  gap: 8px;
  margin-top: 42px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-world-doc .nav a {
  padding: 9px 13px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 999px;
  color: rgba(241, 244, 255, 0.78);
  background: rgba(255, 255, 255, 0.055);
  font-size: 11px;
  font-weight: 700;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.hero-world-doc .nav a:hover,
.hero-world-doc .nav a:focus-visible {
  border-color: rgba(105, 216, 231, 0.5);
  color: #fff;
  background: rgba(105, 216, 231, 0.12);
  outline: none;
}

.hero-world-doc main.shell {
  position: relative;
}

.hero-world-doc .intro {
  position: relative;
  z-index: 2;
  gap: 16px;
  margin-top: -1px;
  padding: 34px 0 38px;
}

.hero-world-doc .intro article {
  position: relative;
  overflow: hidden;
  min-height: 150px;
  padding: 28px 30px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-world-doc .intro article::before {
  content: "";
  position: absolute;
  right: -34px;
  top: -34px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(140, 123, 255, 0.18), transparent 68%);
}

.hero-world-doc .intro article:nth-child(2)::before {
  background: radial-gradient(circle, rgba(105, 216, 231, 0.2), transparent 68%);
}

.hero-world-doc .intro h2 {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: 19px;
  letter-spacing: -0.035em;
}

.hero-world-doc .intro p {
  max-width: 47em;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.hero-world-doc .public-system-section,
.hero-world-doc .roster,
.hero-world-doc .reference-section,
.hero-world-doc .world-section {
  padding: 62px 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: 20px;
}

.hero-world-doc .public-system-heading small,
.hero-world-doc .section-title p,
.hero-world-doc .reference-heading p,
.hero-world-doc .world-spoiler > summary p {
  color: var(--muted);
}

.hero-world-doc .public-system-heading small {
  color: #6658cb;
  letter-spacing: 0.14em;
}

.hero-world-doc .public-system-heading h2,
.hero-world-doc .section-title h2,
.hero-world-doc .reference-heading h2 {
  color: var(--ink);
  font-size: clamp(25px, 3vw, 34px);
  letter-spacing: -0.055em;
}

.hero-world-doc .section-title {
  margin-bottom: 24px;
}

.hero-world-doc .section-title > span:last-child {
  padding: 7px 12px;
  border: 1px solid var(--line);
  color: #4f5870;
  background: #fff;
  box-shadow: 0 5px 18px rgba(19, 24, 43, 0.06);
}

.hero-world-doc .system-block,
.hero-world-doc .grade-block,
.hero-world-doc .relation-block,
.hero-world-doc .org-detail-section,
.hero-world-doc .number-group,
.hero-world-doc .world-spoiler {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 14px 38px rgba(18, 23, 42, 0.06);
}

.hero-world-doc .system-block,
.hero-world-doc .grade-block,
.hero-world-doc .relation-block {
  padding: 26px;
}

.hero-world-doc .system-grid div,
.hero-world-doc .scale-note span,
.hero-world-doc .world-lead,
.hero-world-doc .org-cards article {
  border: 1px solid rgba(41, 48, 70, 0.07);
  border-radius: 13px;
  background: linear-gradient(145deg, #f9f9fc, #f2f3f8);
}

.hero-world-doc .system-grid div {
  padding: 15px;
}

.hero-world-doc .system-grid b,
.hero-world-doc .relation-row b {
  color: #353c50;
  font-size: 12px;
}

.hero-world-doc .system-grid p,
.hero-world-doc .grade-block > div > p,
.hero-world-doc .relation-row span {
  color: var(--muted);
  font-size: 11px;
}

.hero-world-doc .grade-sequence div {
  padding: 12px 7px;
  border: 1px solid rgba(41, 48, 70, 0.09);
  border-radius: 11px;
  background: #f7f7fb;
}

.hero-world-doc .grade-sequence div:first-child {
  border-color: rgba(140, 123, 255, 0.28);
  background: linear-gradient(145deg, #ebe8ff, #f6f4ff);
}

.hero-world-doc .grade-sequence b {
  font-size: 17px;
}

.hero-world-doc .grade-sequence span {
  font-size: 9px;
}

.hero-world-doc .character-grid {
  gap: 24px;
}

.hero-world-doc .character-card {
  position: relative;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(41, 48, 70, 0.1);
  border-top: 0;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.hero-world-doc .character-card::before {
  content: "";
  position: absolute;
  z-index: 3;
  inset: 0 0 auto;
  height: 4px;
  background: var(--accent);
}

.hero-world-doc .character-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 30px 70px rgba(18, 23, 42, 0.16);
}

.hero-world-doc .portrait-box {
  height: 360px;
  border: 0;
  border-radius: 0;
  background:
    radial-gradient(circle at 50% 36%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 42%),
    linear-gradient(145deg, #f4f5f9, #e9ebf2);
}

.hero-world-doc .portrait-box::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 24%;
  background: linear-gradient(to top, rgba(14, 18, 31, 0.08), transparent);
  pointer-events: none;
}

.hero-world-doc .portrait-box img {
  position: relative;
  z-index: 1;
  filter: saturate(0.96) contrast(1.02);
  transition: transform 0.45s ease, filter 0.45s ease;
}

.hero-world-doc .character-card:hover .portrait-box img {
  transform: scale(1.025);
  filter: saturate(1.04) contrast(1.03);
}

.hero-world-doc .portrait-box small {
  z-index: 2;
  right: 12px;
  bottom: 12px;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  color: rgba(32, 39, 51, 0.64);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(8px);
  font-size: 9px;
}

.hero-world-doc .character-head {
  padding: 20px 22px 16px;
  border-bottom: 1px solid rgba(41, 48, 70, 0.08);
}

.hero-world-doc .character-name {
  gap: 11px;
}

.hero-world-doc .character-name small {
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.hero-world-doc .character-name h3 {
  color: var(--ink);
  font-size: 23px;
  letter-spacing: -0.045em;
}

.hero-world-doc .basic-meta span,
.hero-world-doc .traits span {
  border: 1px solid rgba(41, 48, 70, 0.07);
  border-radius: 999px;
  background: #f4f5f9;
}

.hero-world-doc .basic-meta span {
  padding: 5px 8px;
  font-size: 9px;
}

.hero-world-doc .profile-body {
  padding: 20px 22px 8px;
}

.hero-world-doc .ability > b {
  font-size: 10px;
  letter-spacing: 0.12em;
}

.hero-world-doc .ability h4 {
  margin: 5px 0;
  color: #23293b;
  font-size: 20px;
}

.hero-world-doc .ability p {
  min-height: 40px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.hero-world-doc .traits {
  gap: 6px;
  margin: 13px 0;
}

.hero-world-doc .traits span {
  padding: 5px 8px;
  color: #555e74;
  font-size: 10px;
}

.hero-world-doc .profile-body blockquote {
  margin: 12px 0 15px;
  padding: 13px 15px;
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  color: #3a4256;
  background: #f8f8fb;
  font-size: 12px;
  line-height: 1.7;
}

.hero-world-doc .stat {
  grid-template-columns: 34px 22px 1fr;
  gap: 8px;
  font-size: 10px;
}

.hero-world-doc .stat i {
  height: 6px;
  background: #e8e9ef;
}

.hero-world-doc .stat em {
  border-radius: inherit;
}

.hero-world-doc .facts {
  gap: 8px;
  margin: 4px 22px 0;
}

.hero-world-doc .facts div {
  padding: 12px;
  border: 1px solid rgba(41, 48, 70, 0.06);
  border-radius: 11px;
  background: #f7f8fb;
}

.hero-world-doc .facts b {
  color: #4f5870;
  font-size: 10px;
}

.hero-world-doc .facts p {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.65;
}

.hero-world-doc .character-spoiler {
  margin: 14px 22px 22px;
  border: 1px solid rgba(213, 165, 63, 0.25);
  border-radius: 12px;
  background: linear-gradient(145deg, #fffdf7, #fff9e9);
}

.hero-world-doc .character-spoiler summary {
  padding: 12px 14px;
  color: #7a6127;
  font-size: 10px;
}

.hero-world-doc .character-spoiler > p {
  padding: 14px;
  color: #626879;
  font-size: 11px;
  line-height: 1.8;
}

.hero-world-doc summary {
  transition: background 0.2s ease;
}

.hero-world-doc summary:hover {
  background-color: rgba(140, 123, 255, 0.045);
}

.hero-world-doc summary:focus-visible,
.hero-world-doc a:focus-visible {
  outline: 3px solid rgba(140, 123, 255, 0.42);
  outline-offset: 3px;
}

.hero-world-doc .reference-heading {
  align-items: center;
  margin-bottom: 24px;
}

.hero-world-doc .reference-tools,
.hero-world-doc .header-side {
  align-items: flex-end;
}

.hero-world-doc .link-format {
  padding: 10px 13px;
  border: 1px solid rgba(41, 48, 70, 0.08);
  border-radius: 10px;
  color: #4f5870;
  background: #fff;
}

.hero-world-doc .number-grid {
  gap: 16px;
}

.hero-world-doc .number-group {
  padding: 22px;
}

.hero-world-doc .number-group h3 {
  font-size: 17px;
}

.hero-world-doc .number-list div {
  padding: 7px 0;
  border-color: rgba(41, 48, 70, 0.07);
  color: #5a6276;
  font-size: 10px;
}

.hero-world-doc .number-list b {
  min-height: 22px;
  border-radius: 7px;
  color: #4e5570;
  background: #edeef4;
}

.hero-world-doc .world-spoiler {
  overflow: hidden;
}

.hero-world-doc .world-spoiler > summary {
  padding: 26px 28px;
  background:
    radial-gradient(circle at 90% 10%, rgba(140, 123, 255, 0.1), transparent 16rem),
    #fff;
}

.hero-world-doc .world-spoiler > summary h2 {
  color: var(--ink);
  font-size: 24px;
  letter-spacing: -0.045em;
}

.hero-world-doc .world-content {
  padding: 28px;
  border-color: var(--line);
  background: #fafafd;
}

.hero-world-doc .org-cards {
  gap: 12px;
}

.hero-world-doc .org-cards article {
  padding: 18px;
}

.hero-world-doc .org-cards h3 {
  font-size: 16px;
}

.hero-world-doc .org-cards p {
  font-size: 11px;
  line-height: 1.7;
}

.hero-world-doc .world-lead {
  padding: 28px;
  background:
    radial-gradient(circle at 100% 0%, rgba(105, 216, 231, 0.12), transparent 18rem),
    linear-gradient(145deg, #f7f7fb, #eef0f6);
}

.hero-world-doc .world-lead h3,
.hero-world-doc .world-document h3 {
  color: #282f42;
  font-size: 22px;
  letter-spacing: -0.04em;
}

.hero-world-doc .world-lead p,
.hero-world-doc .world-document p {
  color: #60687b;
  font-size: 12px;
  line-height: 1.85;
}

.hero-world-doc .world-block,
.hero-world-doc .org-detail-card {
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
}

.hero-world-doc .world-block {
  padding: 22px;
}

.hero-world-doc .world-block h4,
.hero-world-doc .org-detail-title h4 {
  color: #30374b;
  font-size: 17px;
}

.hero-world-doc .world-block p,
.hero-world-doc .org-detail-card > p {
  font-size: 11px;
  line-height: 1.8;
}

.hero-world-doc .org-detail-section {
  padding: 26px;
  background: #f4f5f9;
}

.hero-world-doc .org-detail-grid {
  gap: 14px;
}

.hero-world-doc .org-detail-card {
  padding: 20px;
}

.hero-world-doc .org-detail-card li {
  color: #687084;
  font-size: 10px;
  line-height: 1.7;
}

.hero-world-doc .footer {
  width: min(1180px, calc(100% - 48px));
  padding: 32px 0 40px;
  border-top: 1px solid var(--line);
  color: #7c8497;
  background: transparent;
  font-size: 10px;
  letter-spacing: 0.06em;
}

.hero-world-doc > .page + .footer,
.hero-world-doc .page ~ .footer {
  position: relative;
}

.hero-world-doc::after {
  content: "";
  display: block;
  height: 1px;
  background: var(--night);
}

.back-to-top {
  position: fixed;
  z-index: 20;
  right: 22px;
  bottom: 22px;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  color: #fff !important;
  background: rgba(14, 18, 31, 0.82);
  box-shadow: 0 12px 30px rgba(8, 11, 20, 0.25);
  backdrop-filter: blur(12px);
  font-size: 18px;
  transition: transform 0.2s ease, background 0.2s ease;
}

.back-to-top:hover {
  transform: translateY(-3px);
  background: #6e5cc8;
}

@media (max-width: 900px) {
  .hero-world-doc .shell,
  .hero-world-doc .footer {
    width: min(100% - 32px, 720px);
  }

  .hero-world-doc .document-header {
    padding-top: 58px;
  }

  .hero-world-doc .header-row {
    align-items: flex-start;
  }

  .hero-world-doc .header-side,
  .hero-world-doc .reference-tools {
    width: 100%;
    align-items: flex-start;
  }

  .hero-world-doc .character-grid,
  .hero-world-doc .org-cards,
  .hero-world-doc .org-detail-grid,
  .hero-world-doc .world-summary-grid {
    grid-template-columns: 1fr;
  }

  .hero-world-doc .portrait-box {
    height: min(68vw, 520px);
  }
}

@media (max-width: 600px) {
  .hero-world-doc .shell,
  .hero-world-doc .footer {
    width: calc(100% - 24px);
  }

  .hero-world-doc .document-header {
    padding: 42px 0 24px;
  }

  .hero-world-doc .document-header h1 {
    font-size: clamp(38px, 13vw, 52px);
  }

  .hero-world-doc .document-header p:not(.title-label) {
    font-size: 14px;
  }

  .hero-world-doc .preview-link,
  .hero-world-doc .top-preview-link {
    width: 100%;
  }

  .hero-world-doc .doc-stats span {
    min-width: calc(33.33% - 6px);
  }

  .hero-world-doc .nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-world-doc .nav a {
    display: grid;
    place-items: center;
    min-height: 40px;
    padding: 7px 9px;
    text-align: center;
  }

  .hero-world-doc .intro {
    grid-template-columns: 1fr;
    padding: 22px 0 30px;
  }

  .hero-world-doc .intro article {
    min-height: 0;
    padding: 22px;
  }

  .hero-world-doc .public-system-section,
  .hero-world-doc .roster,
  .hero-world-doc .reference-section,
  .hero-world-doc .world-section {
    padding: 44px 0;
  }

  .hero-world-doc .system-block,
  .hero-world-doc .grade-block,
  .hero-world-doc .relation-block,
  .hero-world-doc .org-detail-section,
  .hero-world-doc .world-content,
  .hero-world-doc .world-spoiler > summary {
    padding: 19px;
  }

  .hero-world-doc .system-grid,
  .hero-world-doc .facts,
  .hero-world-doc .number-list,
  .hero-world-doc .number-group.wide .number-list {
    grid-template-columns: 1fr;
  }

  .hero-world-doc .grade-sequence {
    grid-template-columns: repeat(3, 1fr);
  }

  .hero-world-doc .character-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-world-doc .basic-meta {
    justify-content: flex-start;
  }

  .hero-world-doc .portrait-box {
    height: auto;
    aspect-ratio: 4 / 5;
  }

  .hero-world-doc .reference-heading {
    align-items: flex-start;
  }

  .hero-world-doc .link-format {
    width: 100%;
    overflow-wrap: anywhere;
  }

  .back-to-top {
    right: 14px;
    bottom: 14px;
    width: 42px;
    height: 42px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .hero-world-doc .document-header h1,
  .hero-world-doc .document-header p,
  .hero-world-doc .header-side {
    animation: hero-enter 0.7s both;
  }

  .hero-world-doc .document-header p {
    animation-delay: 0.08s;
  }

  .hero-world-doc .header-side {
    animation-delay: 0.16s;
  }

  @keyframes hero-enter {
    from {
      opacity: 0;
      transform: translateY(14px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}
