:root {
  color-scheme: dark;
  --ink: #f6efe4;
  --muted: #c9bba8;
  --soft: #9d8f82;
  --panel: #201b1a;
  --panel-2: #29211f;
  --line: rgba(246, 239, 228, 0.16);
  --blood: #8d1e35;
  --blood-2: #c73b4e;
  --gold: #d7ae5f;
  --mint: #7cc5a3;
  --violet: #a77af2;
  --sky: #8fb9d8;
  --shadow: rgba(0, 0, 0, 0.48);
}

/* 2026 workspace refresh: shared shell and navigation */
:root {
  --canvas: #0d1018;
  --canvas-2: #121722;
  --panel: #171c28;
  --panel-2: #1e2432;
  --ink: #f7f3ed;
  --muted: #b7bdc9;
  --soft: #858d9d;
  --line: rgba(224, 229, 240, 0.12);
  --line-strong: rgba(224, 229, 240, 0.22);
  --blood: #913d5b;
  --blood-2: #ef6f91;
  --gold: #f2bd68;
  --mint: #76d9bd;
  --violet: #a995ff;
  --sky: #8fc7ff;
  --shadow: rgba(0, 0, 0, 0.36);
  --focus-ring: 0 0 0 3px rgba(143, 199, 255, 0.24);
}

body {
  background:
    radial-gradient(circle at 16% -12%, rgba(169, 149, 255, 0.13), transparent 32rem),
    radial-gradient(circle at 88% 0%, rgba(239, 111, 145, 0.1), transparent 28rem),
    var(--canvas);
  font-family: "Pretendard Variable", Pretendard, "Noto Sans KR", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.site-header {
  min-height: 68px;
  padding: 0 clamp(18px, 3vw, 42px);
  border-bottom: 1px solid var(--line);
}

.site-header.is-scrolled {
  background: rgba(13, 16, 24, 0.82);
  border-color: var(--line);
  backdrop-filter: blur(22px) saturate(1.35);
}

.brand {
  gap: 12px;
  font-size: 15px;
  letter-spacing: 0.02em;
}

.brand-mark {
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 6px 2px 6px 2px;
  background: linear-gradient(135deg, var(--gold), var(--blood-2) 58%, var(--violet));
  box-shadow: 0 0 22px rgba(239, 111, 145, 0.28);
  transform: rotate(-8deg);
}

.top-nav {
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
}

.top-nav a {
  min-height: 34px;
  padding: 7px 13px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 750;
}

.top-nav a:hover,
.top-nav a:focus-visible,
.top-nav a[aria-current="page"] {
  background: rgba(255, 255, 255, 0.075);
  color: var(--ink);
}

.top-nav a[aria-current="page"] {
  box-shadow: inset 0 -2px 0 var(--blood-2);
}

.section-kicker,
.eyebrow {
  color: var(--blood-2);
  letter-spacing: 0.13em;
}

@media (max-width: 720px) {
  .site-header {
    min-height: 58px;
    padding: 0 14px;
  }

  .brand span:last-child {
    display: none;
  }

  .top-nav {
    max-width: calc(100vw - 58px);
    gap: 2px;
    overflow-x: auto;
    border: 0;
    padding: 0;
    background: transparent;
    scrollbar-width: none;
  }

  .top-nav a {
    min-height: 34px;
    padding: 7px 10px;
    white-space: nowrap;
  }

  .workspace-dock {
    display: none;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #120f10 0%, #181312 42%, #211813 100%);
  color: var(--ink);
  font-family: "Segoe UI", "Noto Sans KR", Arial, sans-serif;
  line-height: 1.65;
  letter-spacing: 0;
}

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

button {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 28px;
  border-bottom: 1px solid transparent;
  transition: background 180ms ease, border-color 180ms ease, backdrop-filter 180ms ease;
}

.site-header.is-scrolled {
  background: rgba(18, 15, 16, 0.84);
  border-color: var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
}

.brand-mark {
  width: 14px;
  height: 28px;
  display: inline-block;
  background: linear-gradient(180deg, var(--gold), var(--blood-2));
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 3px;
  transform: skew(-10deg);
}

.top-nav {
  display: flex;
  gap: 20px;
  align-items: center;
  color: var(--muted);
  font-size: 14px;
}

.top-nav a {
  padding: 10px 0;
}

.top-nav a:hover,
.top-nav a:focus-visible {
  color: var(--ink);
}

.hero {
  position: relative;
  display: grid;
  align-items: center;
  min-height: min(74vh, 760px);
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero-media {
  position: absolute;
  inset: 0;
  background-image: url("assets/morgav-hero.png");
  background-size: cover;
  background-position: center;
  transform: scale(1.01);
}

.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(12, 9, 9, 0.88) 0%, rgba(12, 9, 9, 0.46) 42%, rgba(12, 9, 9, 0.12) 78%),
    linear-gradient(180deg, rgba(12, 9, 9, 0.18) 0%, rgba(12, 9, 9, 0.82) 100%);
}

.hero-content {
  position: relative;
  width: min(680px, calc(100% - 40px));
  margin-left: clamp(20px, 8vw, 112px);
  padding: 78px 0 72px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-size: clamp(48px, 8vw, 104px);
  line-height: 0.96;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 620px;
  margin: 24px 0 0;
  color: #f3e6d4;
  font-size: clamp(18px, 2.1vw, 24px);
  word-break: keep-all;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.primary-link,
.ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 6px;
  font-weight: 800;
}

.primary-link {
  background: var(--gold);
  color: #20130e;
}

.ghost-link {
  border: 1px solid rgba(246, 239, 228, 0.38);
  color: var(--ink);
  background: rgba(12, 9, 9, 0.32);
}

.section {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 76px 0;
}

.section h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 56px);
  line-height: 1.08;
  letter-spacing: 0;
}

.section h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.22;
  letter-spacing: 0;
}

.section p {
  color: var(--muted);
  font-size: 17px;
  word-break: keep-all;
}

.intro-grid,
.split-section,
.stage-band {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 44px;
  align-items: start;
}

.fact-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(32, 27, 26, 0.74);
  box-shadow: 0 24px 60px var(--shadow);
}

.fact-panel dl {
  margin: 0;
}

.fact-panel div {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.fact-panel div:last-child {
  border-bottom: 0;
}

.fact-panel dt {
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
}

.fact-panel dd {
  margin: 6px 0 0;
  color: var(--ink);
}

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

.pillar-grid,
.character-grid,
.doc-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.pillar,
.character,
.doc-link {
  min-height: 210px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(41, 33, 31, 0.96), rgba(30, 24, 23, 0.96));
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.pillar:hover,
.character:hover,
.doc-link:hover,
.doc-link:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(215, 174, 95, 0.58);
}

.number {
  display: block;
  margin-bottom: 30px;
  color: var(--mint);
  font-weight: 900;
}

.pillar p,
.character span,
.doc-link em {
  display: block;
  margin-top: 14px;
  color: var(--muted);
  font-style: normal;
}

.timeline {
  display: grid;
  gap: 12px;
}

.timeline div {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  min-height: 72px;
  padding: 18px;
  border-left: 4px solid var(--blood-2);
  border-radius: 8px;
  background: rgba(41, 33, 31, 0.86);
}

.timeline span {
  color: var(--soft);
  font-size: 14px;
  font-weight: 800;
}

.timeline strong {
  color: var(--ink);
  font-size: 18px;
}

.loop-list {
  display: grid;
  gap: 9px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: loop;
}

.loop-list li {
  counter-increment: loop;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  color: var(--ink);
}

.loop-list li::before {
  content: counter(loop);
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(141, 30, 53, 0.92);
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.stage-band {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 72px max(20px, calc((100vw - 1180px) / 2));
  background:
    linear-gradient(90deg, rgba(141, 30, 53, 0.42), rgba(32, 27, 26, 0.92)),
    linear-gradient(180deg, #251816, #181312);
  border-block: 1px solid var(--line);
}

.boss-card {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: end;
  min-height: 260px;
  padding: 24px;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(12, 9, 9, 0.14), rgba(12, 9, 9, 0.58)),
    linear-gradient(135deg, var(--gold), var(--blood), var(--violet));
  box-shadow: 0 24px 70px var(--shadow);
}

.boss-card p {
  margin: 0 0 8px;
  color: #1c1110;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.boss-card h3 {
  color: #fff8ef;
  font-size: 36px;
}

.boss-card span {
  margin-top: 12px;
  color: #f7eadc;
  font-weight: 700;
}

.character {
  min-height: 184px;
}

.character p {
  margin: 0 0 34px;
  color: var(--sky);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.wiki-section {
  padding-bottom: 90px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: end;
}

.filter-button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(32, 27, 26, 0.8);
  color: var(--muted);
  cursor: pointer;
}

.filter-button:hover,
.filter-button:focus-visible,
.filter-button.active {
  border-color: rgba(215, 174, 95, 0.66);
  color: var(--ink);
  background: rgba(141, 30, 53, 0.5);
}

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

.doc-link {
  min-height: 164px;
}

.doc-link[hidden] {
  display: none;
}

.doc-link span {
  display: block;
  margin-bottom: 24px;
  color: var(--mint);
  font-size: 13px;
  font-weight: 900;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 28px;
  border-top: 1px solid var(--line);
  color: var(--soft);
  background: #100d0d;
}

.site-footer a {
  color: var(--gold);
  font-weight: 800;
}

@media (max-width: 920px) {
  body {
    padding-bottom: calc(92px + env(safe-area-inset-bottom));
  }

  .site-header {
    align-items: center;
    flex-direction: row;
    min-height: 56px;
    padding: 8px 14px;
    background: rgba(18, 15, 16, 0.9);
    border-bottom-color: var(--line);
    backdrop-filter: none;
  }

  .site-header.is-scrolled {
    backdrop-filter: none;
  }

  .top-nav {
    position: fixed;
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
    left: 8px;
    z-index: 60;
    display: flex;
    flex-wrap: nowrap;
    gap: 2px;
    width: auto;
    margin: 0;
    overflow-x: auto;
    overflow-y: hidden;
    border: 1px solid rgba(246, 239, 228, 0.14);
    border-radius: 8px;
    padding: 4px;
    background: rgba(16, 18, 20, 0.97);
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.44);
    backdrop-filter: blur(16px);
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .top-nav::-webkit-scrollbar {
    display: none;
  }

  .top-nav a[aria-current="page"] {
    border-color: transparent;
    background: rgba(124, 197, 163, 0.13);
    color: var(--ink);
    box-shadow: inset 0 2px 0 var(--mint);
  }

  .top-nav::after {
    display: none;
  }

  .top-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 72px;
    min-width: 72px;
    min-height: 42px;
    border: 0;
    border-radius: 5px;
    padding: 0 3px;
    background: transparent;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    white-space: nowrap;
  }

  .hero {
    min-height: calc(100svh - 56px);
  }

  .hero-content {
    margin-left: 20px;
    padding-top: 70px;
  }

  .intro-grid,
  .split-section,
  .stage-band {
    grid-template-columns: 1fr;
  }

  .pillar-grid,
  .character-grid,
  .doc-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .filter-row {
    justify-content: start;
  }
}

@media (max-width: 620px) {
  .hero-content {
    width: calc(100% - 32px);
    margin-left: 16px;
    padding-bottom: 56px;
  }

  .hero-shade {
    background:
      linear-gradient(90deg, rgba(12, 9, 9, 0.88), rgba(12, 9, 9, 0.52)),
      linear-gradient(180deg, rgba(12, 9, 9, 0.14), rgba(12, 9, 9, 0.88));
  }

  .section {
    width: calc(100% - 32px);
    padding: 58px 0;
  }

  .stage-band {
    width: 100%;
    padding: 58px 16px;
  }

  .pillar-grid,
  .character-grid,
  .doc-grid {
    grid-template-columns: 1fr;
  }

  .pillar,
  .character,
  .doc-link {
    min-height: auto;
  }

  .timeline div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .site-footer {
    flex-direction: column;
    padding: 24px 16px;
  }
}

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: rgba(215, 174, 95, 0.18);
}

input,
select,
textarea {
  font-size: 16px;
}

img,
video,
canvas {
  max-width: 100%;
  height: auto;
}

.mobile-panel-toggle {
  display: none;
}

.doc-ref {
  color: var(--gold);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.doc-ref:hover,
.doc-ref:focus-visible {
  color: #ffe0a3;
}

.panel-empty,
.board-empty {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px dashed rgba(246, 239, 228, 0.2);
  border-radius: 8px;
  background: rgba(18, 15, 16, 0.34);
  color: var(--muted);
}

.panel-empty strong,
.board-empty strong {
  color: var(--ink);
  font-size: 16px;
}

.panel-empty p,
.board-empty p {
  margin: 0;
  color: var(--soft);
}

.board-empty button {
  width: fit-content;
  min-height: 42px;
  border: 1px solid var(--gold);
  border-radius: 6px;
  padding: 0 14px;
  background: var(--gold);
  color: #21130e;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
}

@media (hover: none) {
  .pillar:hover,
  .character:hover,
  .doc-link:hover {
    transform: none;
  }
}

@media (max-width: 920px) {
  .hero {
    min-height: calc(100svh - 56px);
  }

  .hero-content {
    padding-top: 72px;
  }

  .primary-link,
  .ghost-link,
  .filter-button,
  .category-pill,
  .small-button,
  .save-button {
    min-height: 44px;
  }
}

@media (max-width: 620px) {
  body {
    overflow-x: hidden;
  }

  .hero h1 {
    font-size: clamp(40px, 16vw, 64px);
  }

  .hero-copy,
  .section p {
    font-size: 16px;
  }

  .hero-actions,
  .filter-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .primary-link,
  .ghost-link,
  .filter-button {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .hero-actions,
  .filter-row {
    grid-template-columns: 1fr;
  }
}

/* Shared shell overrides stay last so legacy page rules cannot mute the refresh. */
body {
  background:
    radial-gradient(circle at 16% -12%, rgba(169, 149, 255, 0.13), transparent 32rem),
    radial-gradient(circle at 88% 0%, rgba(239, 111, 145, 0.1), transparent 28rem),
    var(--canvas);
  font-family: "Pretendard Variable", Pretendard, "Noto Sans KR", "Segoe UI", sans-serif;
}

.site-header {
  min-height: 68px;
  padding: 0 clamp(18px, 3vw, 42px);
  border-bottom: 1px solid var(--line);
}

.site-header.is-scrolled {
  background: rgba(13, 16, 24, 0.82);
  border-color: var(--line);
  backdrop-filter: blur(22px) saturate(1.35);
}

.brand {
  gap: 12px;
  font-size: 15px;
  letter-spacing: 0.02em;
}

.brand-mark {
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 6px 2px 6px 2px;
  background: linear-gradient(135deg, var(--gold), var(--blood-2) 58%, var(--violet));
  box-shadow: 0 0 22px rgba(239, 111, 145, 0.28);
  transform: rotate(-8deg);
}

.top-nav {
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
}

.top-nav a {
  min-height: 34px;
  padding: 7px 13px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 750;
}

.top-nav a:hover,
.top-nav a:focus-visible,
.top-nav a[aria-current="page"] {
  background: rgba(255, 255, 255, 0.075);
  color: var(--ink);
}

.top-nav a[aria-current="page"] {
  box-shadow: inset 0 -2px 0 var(--blood-2);
}

.section-kicker,
.eyebrow {
  color: var(--blood-2);
  letter-spacing: 0.13em;
}

@media (max-width: 720px) {
  .site-header {
    min-height: 58px;
    padding: 0 14px;
  }

  .brand span:last-child {
    display: none;
  }

  .top-nav {
    max-width: calc(100vw - 58px);
    gap: 2px;
    overflow-x: auto;
    border: 0;
    padding: 0;
    background: transparent;
    scrollbar-width: none;
  }

  .top-nav a {
    min-height: 34px;
    padding: 7px 10px;
    white-space: nowrap;
  }
}
