@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;700;900&family=Orbitron:wght@500;600;700;800&display=swap');

:root {
  --font-sans: "Noto Sans KR", system-ui, -apple-system, sans-serif;
  --font-display: "Orbitron", "Noto Sans KR", sans-serif;
  --bg: #030711;
  --bg-deep: #01040a;
  --panel: rgba(10, 19, 36, 0.78);
  --panel-strong: rgba(13, 24, 45, 0.94);
  --line: rgba(128, 190, 255, 0.16);
  --cyan: #63dcff;
  --blue: #6d8dff;
  --violet: #ad7cff;
  --pink: #ff6ea8;
  --gold: #ffd166;
  --mint: #62efc5;
  --danger: #ff647d;
  --text: #eef6ff;
  --muted: #92a6c2;
  --max-width: 1180px;
  --shadow: 0 20px 70px rgba(0, 0, 0, 0.42);
  --transition: 180ms ease;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-sans);
  color: var(--text);
  background:
    radial-gradient(circle at 15% 10%, rgba(99, 220, 255, 0.08), transparent 28rem),
    radial-gradient(circle at 88% 22%, rgba(173, 124, 255, 0.09), transparent 32rem),
    linear-gradient(180deg, #050b18 0%, var(--bg) 45%, var(--bg-deep) 100%);
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.24;
  background-image:
    linear-gradient(rgba(99, 220, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 220, 255, 0.08) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

code {
  font-family: var(--font-display);
}

.site-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-top: 72px;
}

.site-header.mdh {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 100;
  border-bottom: 1px solid var(--line);
  background: rgba(3, 7, 17, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.mdh-nav {
  width: min(100% - 32px, var(--max-width));
  height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.mdh-brand {
  display: flex;
  flex-direction: column;
  line-height: 1.12;
}

.mdh-brand strong {
  font-family: var(--font-display);
  font-size: 17px;
  letter-spacing: 0.08em;
  background: linear-gradient(90deg, #fff, var(--cyan), var(--violet));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.mdh-brand span {
  margin-top: 5px;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 8px;
  letter-spacing: 0.22em;
}

.mdh-nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mdh-nav-links a {
  padding: 9px 13px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  transition: var(--transition);
}

.mdh-nav-links a:hover,
.mdh-nav-links a.active {
  color: #fff;
  border-color: rgba(99, 220, 255, 0.24);
  background: rgba(99, 220, 255, 0.08);
}

.mdh-nav-links .portal-link {
  margin-left: 7px;
  border-color: rgba(173, 124, 255, 0.2);
  color: #c9b5ff;
}

.mdh-container {
  width: min(100% - 40px, var(--max-width));
  margin: 0 auto;
  padding: 56px 0 88px;
}

.mdh-hero {
  min-height: min(720px, calc(100vh - 104px));
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(320px, 0.82fr);
  align-items: center;
  gap: 52px;
  overflow: hidden;
  padding: clamp(42px, 7vw, 88px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    radial-gradient(circle at 78% 50%, rgba(99, 220, 255, 0.12), transparent 30%),
    radial-gradient(circle at 20% 0%, rgba(173, 124, 255, 0.12), transparent 42%),
    linear-gradient(145deg, rgba(13, 25, 47, 0.96), rgba(4, 8, 18, 0.98));
  box-shadow: var(--shadow);
}

.mdh-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, rgba(255,255,255,0.035), transparent 36%);
}

.mdh-hero-copy {
  position: relative;
  z-index: 2;
}

.mdh-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  color: var(--cyan);
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.18em;
}

.mdh-eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
}

.mdh-hero h1 {
  max-width: 760px;
  font-family: var(--font-display);
  font-size: clamp(40px, 6.8vw, 82px);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.mdh-hero h1 span {
  display: block;
  margin-top: 8px;
  color: transparent;
  -webkit-text-stroke: 1px rgba(173, 124, 255, 0.9);
  text-shadow: 0 0 32px rgba(173, 124, 255, 0.14);
}

.mdh-lead {
  max-width: 680px;
  margin-top: 26px;
  color: #b7c8de;
  font-size: clamp(15px, 2vw, 18px);
  line-height: 1.85;
}

.mdh-tags,
.mdh-actions,
.anchor-list {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.mdh-tags {
  margin-top: 24px;
}

.mdh-tags span {
  padding: 6px 10px;
  border: 1px solid rgba(109, 141, 255, 0.2);
  border-radius: 5px;
  background: rgba(109, 141, 255, 0.07);
  color: #b8c7ff;
  font-size: 12px;
}

.mdh-actions {
  margin-top: 32px;
}

.mdh-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid rgba(99, 220, 255, 0.28);
  border-radius: 9px;
  background: rgba(99, 220, 255, 0.09);
  color: #dff8ff;
  font-size: 13px;
  font-weight: 800;
  transition: var(--transition);
}

.mdh-button:hover {
  transform: translateY(-2px);
  border-color: var(--cyan);
  box-shadow: 0 10px 28px rgba(99, 220, 255, 0.12);
}

.mdh-button.secondary {
  border-color: rgba(173, 124, 255, 0.24);
  background: rgba(173, 124, 255, 0.08);
}

.rift-stage {
  position: relative;
  min-height: 420px;
  display: grid;
  place-items: center;
}

.rift-ring {
  position: absolute;
  width: min(31vw, 360px);
  aspect-ratio: 1;
  border: 1px solid rgba(99, 220, 255, 0.32);
  border-radius: 50%;
  box-shadow:
    0 0 28px rgba(99, 220, 255, 0.15),
    inset 0 0 28px rgba(173, 124, 255, 0.12);
}

.rift-ring::before,
.rift-ring::after {
  content: "";
  position: absolute;
  border-radius: 50%;
}

.rift-ring::before {
  inset: 11%;
  border: 2px dashed rgba(173, 124, 255, 0.48);
  animation: spin 24s linear infinite;
}

.rift-ring::after {
  inset: 25%;
  background:
    radial-gradient(circle, #d9fbff 0 2%, #6edfff 3%, rgba(89, 120, 255, 0.7) 12%, rgba(88, 35, 164, 0.7) 34%, rgba(2, 7, 19, 0.98) 68%);
  box-shadow: 0 0 60px rgba(99, 220, 255, 0.35);
}

.rift-orbit {
  position: absolute;
  width: min(38vw, 440px);
  aspect-ratio: 1;
  border: 1px solid rgba(255, 209, 102, 0.12);
  border-radius: 50%;
  transform: rotate(24deg);
}

.rift-orbit::before,
.rift-orbit::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 18px var(--gold);
}

.rift-orbit::before {
  top: 18%;
  left: 11%;
}

.rift-orbit::after {
  right: 8%;
  bottom: 24%;
  background: var(--pink);
  box-shadow: 0 0 18px var(--pink);
}

.rift-label {
  position: relative;
  z-index: 4;
  width: 148px;
  text-align: center;
  font-family: var(--font-display);
  color: #e9fbff;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-shadow: 0 0 16px var(--cyan);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin: 18px 0 64px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--line);
}

.stat-item {
  padding: 20px 14px;
  background: rgba(6, 13, 26, 0.94);
  text-align: center;
}

.stat-item strong {
  display: block;
  font-family: var(--font-display);
  color: #fff;
  font-size: 20px;
}

.stat-item span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.section {
  margin-top: 72px;
  scroll-margin-top: 94px;
}

.section:first-child {
  margin-top: 0;
}

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

.section-kicker {
  display: block;
  margin-bottom: 8px;
  color: var(--cyan);
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0.18em;
}

.section-heading h2 {
  font-size: clamp(27px, 4vw, 42px);
  letter-spacing: -0.04em;
}

.section-heading p {
  max-width: 520px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
  text-align: right;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.content-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mdh-card,
.route-card,
.roster-group {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.18);
}

.mdh-card {
  padding: 26px;
  border-radius: 16px;
}

.mdh-card h3 {
  margin-bottom: 12px;
  color: #fff;
  font-size: 18px;
}

.mdh-card p,
.mdh-card li {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}

.mdh-card ul {
  padding-left: 18px;
}

.route-card {
  position: relative;
  min-height: 248px;
  padding: 26px;
  overflow: hidden;
  border-radius: 18px;
  transition: var(--transition);
}

.route-card::after {
  content: attr(data-route);
  position: absolute;
  right: -8px;
  bottom: -22px;
  color: rgba(255, 255, 255, 0.025);
  font-family: var(--font-display);
  font-size: 74px;
  font-weight: 800;
}

.route-card:hover {
  transform: translateY(-4px);
  border-color: rgba(99, 220, 255, 0.36);
}

.route-number {
  color: var(--cyan);
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.16em;
}

.route-card h3 {
  margin-top: 18px;
  font-size: 21px;
}

.route-card p {
  position: relative;
  z-index: 2;
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.route-card.spy {
  border-color: rgba(255, 100, 125, 0.22);
  background: linear-gradient(145deg, rgba(45, 12, 25, 0.76), rgba(11, 18, 33, 0.88));
}

.route-card.lilias {
  border-color: rgba(255, 110, 168, 0.2);
}

.rank-rail {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 7px;
}

.rank-step {
  padding: 13px 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 16, 31, 0.84);
  text-align: center;
  font-family: var(--font-display);
  font-size: 12px;
}

.rank-step.high {
  color: var(--gold);
  border-color: rgba(255, 209, 102, 0.24);
}

.page-hero {
  padding: 66px 0 42px;
  border-bottom: 1px solid var(--line);
}

.page-hero-inner {
  width: min(100% - 40px, var(--max-width));
  margin: 0 auto;
}

.page-hero h1 {
  max-width: 820px;
  font-family: var(--font-display);
  font-size: clamp(36px, 7vw, 72px);
  letter-spacing: -0.055em;
}

.page-hero p {
  max-width: 720px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.anchor-list {
  margin-top: 24px;
}

.anchor-list a {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: #b9c9df;
  font-size: 12px;
  font-weight: 700;
}

.anchor-list a:hover {
  color: #fff;
  border-color: rgba(99, 220, 255, 0.38);
}

.roster-group {
  padding: 24px;
  border-radius: 18px;
  scroll-margin-top: 96px;
}

.roster-group + .roster-group {
  margin-top: 22px;
}

.roster-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.roster-group-header h2 {
  font-size: 22px;
}

.roster-count {
  color: var(--cyan);
  font-family: var(--font-display);
  font-size: 11px;
}

.roster-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.char-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(128, 190, 255, 0.11);
  border-radius: 14px;
  background: rgba(5, 12, 24, 0.72);
  transition: var(--transition);
}

.char-card:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 220, 255, 0.32);
  background: rgba(12, 23, 43, 0.88);
}

.char-portrait {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 35%, rgba(99, 220, 255, 0.18), transparent 42%),
    linear-gradient(145deg, rgba(99, 220, 255, 0.08), rgba(173, 124, 255, 0.14));
}

.char-portrait img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center top;
  transition: transform 0.35s ease;
}

.char-portrait img[role="button"] {
  cursor: zoom-in;
}

.char-portrait img[role="button"]:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: -4px;
}

.char-card:hover .char-portrait img {
  transform: scale(1.035);
}

.char-code {
  position: absolute;
  top: 10px;
  left: 10px;
  min-width: 42px;
  height: 30px;
  padding: 0 10px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(99, 220, 255, 0.25);
  border-radius: 999px;
  background: rgba(3, 7, 17, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #dff8ff;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
}

.char-body {
  min-width: 0;
  width: 100%;
  padding: 16px;
}

.char-name {
  color: #fff;
  font-size: 18px;
  font-weight: 800;
}

.char-role {
  margin-top: 6px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.char-description {
  min-height: 3.2em;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.mdh-scroll-nav {
  position: fixed;
  right: max(12px, calc((100vw - var(--max-width)) / 2 - 58px));
  top: 50%;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transform: translateY(-50%);
  pointer-events: none;
}

.mdh-scroll-nav button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(99, 220, 255, 0.2);
  border-radius: 12px;
  background: rgba(3, 7, 17, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px) scale(0.92);
  transition: var(--transition);
  pointer-events: none;
}

.mdh-scroll-nav button.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.mdh-scroll-nav button:hover {
  border-color: rgba(99, 220, 255, 0.5);
  background: rgba(12, 23, 43, 0.94);
  color: #fff;
  box-shadow: 0 0 22px rgba(99, 220, 255, 0.14);
}

body.mdh-modal-open {
  overflow: hidden;
}

.mdh-lightbox[hidden] {
  display: none;
}

.mdh-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 32px;
  background: rgba(1, 4, 10, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.mdh-lightbox.open {
  opacity: 1;
}

.mdh-lightbox-dialog {
  position: relative;
  display: flex;
  max-width: min(92vw, 1100px);
  max-height: 92vh;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.mdh-lightbox-image {
  max-width: 100%;
  max-height: calc(92vh - 54px);
  display: block;
  border: 1px solid rgba(99, 220, 255, 0.24);
  border-radius: 16px;
  object-fit: contain;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.62);
}

.mdh-lightbox-caption {
  margin: 0;
  color: #dcecff;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.mdh-lightbox-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background: rgba(3, 7, 17, 0.82);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  transition: var(--transition);
}

.mdh-lightbox-close:hover,
.mdh-lightbox-close:focus-visible {
  border-color: var(--cyan);
  background: rgba(12, 23, 43, 0.96);
  outline: none;
  box-shadow: 0 0 22px rgba(99, 220, 255, 0.2);
}

.site-footer {
  margin-top: auto;
  padding: 34px 20px;
  border-top: 1px solid var(--line);
  background: rgba(1, 4, 10, 0.86);
  color: #6f829d;
  text-align: center;
  font-size: 12px;
}

@media (max-width: 900px) {
  .mdh-hero {
    min-height: auto;
    grid-template-columns: 1fr;
    padding: 54px 34px;
  }

  .rift-stage {
    min-height: 330px;
    order: -1;
  }

  .rift-ring {
    width: 300px;
  }

  .rift-orbit {
    width: 365px;
  }

  .content-grid.three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .roster-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .site-wrapper {
    padding-top: 108px;
  }

  .mdh-nav {
    height: 108px;
    padding: 10px 0;
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .mdh-nav-links {
    width: 100%;
    max-width: none;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .mdh-nav-links::-webkit-scrollbar {
    display: none;
  }

  .mdh-nav-links a {
    padding: 6px 8px;
    font-size: 11px;
  }

  .mdh-nav-links .portal-link {
    margin-left: 0;
  }

  .mdh-container {
    width: min(100% - 24px, var(--max-width));
    padding-top: 32px;
  }

  .mdh-hero {
    padding: 36px 22px 42px;
    border-radius: 18px;
  }

  .rift-stage {
    min-height: 270px;
  }

  .rift-ring {
    width: 230px;
  }

  .rift-orbit {
    width: 280px;
  }

  .stats-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .section {
    margin-top: 54px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-heading p {
    text-align: left;
  }

  .content-grid,
  .content-grid.three,
  .roster-grid {
    grid-template-columns: 1fr;
  }

  .rank-rail {
    grid-template-columns: repeat(4, 1fr);
  }

  .page-hero {
    padding-top: 44px;
  }

  .roster-group {
    padding: 17px;
    scroll-margin-top: 124px;
  }

  .mdh-scroll-nav {
    right: 10px;
  }

  .mdh-scroll-nav button {
    width: 40px;
    height: 40px;
  }

  .mdh-lightbox {
    padding: 16px;
  }

  .mdh-lightbox-image {
    max-height: calc(92vh - 48px);
    border-radius: 12px;
  }

  .mdh-lightbox-close {
    top: 8px;
    right: 8px;
    width: 38px;
    height: 38px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
