:root {
  --background: #000000;
  --primary: #2a8a7a;
  --secondary: #ffffff;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  height: 100%;
  margin: 0;
  background: var(--background);
  color: var(--secondary);
  font-family: Inter, Arial, sans-serif;
  overflow: hidden;
}

button,
a {
  font: inherit;
}

img {
  display: block;
  user-select: none;
}

.department-page {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--background);
}

.dept-nav {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px clamp(24px, 4.17vw, 80px);
  transition: opacity 400ms ease;
}

.department-page:has([data-loading]:not(.is-done)) .dept-nav {
  opacity: 0;
  pointer-events: none;
}

.dept-logo {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 24px;
  color: var(--secondary);
  text-decoration: none;
}

.dept-logo img {
  width: 24px;
  height: 23px;
}

.dept-logo span {
  font-family: Orbitron, sans-serif;
  font-size: 14px;
  line-height: 1;
  letter-spacing: 16px;
}

.employee {
  display: none;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  font-weight: 400;
  line-height: 1;
}

.employee p {
  margin: 0;
  color: var(--secondary);
  font-family: Orbitron, sans-serif;
  font-size: 16px;
  line-height: 1;
  letter-spacing: 2px;
  text-transform: uppercase;
  white-space: nowrap;
}

.employee span {
  color: var(--primary);
  font-size: 10px;
  line-height: 1;
}

.dept-main {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px clamp(24px, 4.17vw, 80px);
  overflow: hidden;
}

.cursor {
  color: var(--primary);
  animation: cursor-blink 900ms steps(2, end) infinite;
}

.cursor.is-hidden {
  display: none;
}

.map-stage {
  position: relative;
  width: min(900px, 100%, calc((100vh - 238px) * 1.4516));
  max-height: 100%;
  aspect-ratio: 900 / 620;
  transform-style: preserve-3d;
  transform: perspective(1000px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
  transition: transform 120ms ease-out;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: var(--background);
  opacity: 1;
  overflow: hidden;
  transition: opacity 520ms cubic-bezier(0.22, 1, 0.36, 1), visibility 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

.loading-overlay.is-done {
  opacity: 0;
  visibility: hidden;
}

.loading-face-nav {
  display: none;
}

.loading-face-nav img {
  width: 24px;
  height: 23px;
}

.loading-face-nav span {
  font-family: Orbitron, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 16px;
  color: var(--secondary);
}

.loading-figure {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: min(460px, 44vh);
  z-index: 1;
  pointer-events: none;
}

.loading-figure img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.loading-scantrack {
  position: absolute;
  left: 0;
  right: 0;
  top: 20vh;
  z-index: 3;
  transition: opacity 300ms ease;
}

.loading-scanrow {
  position: relative;
  height: 24px;
}


.loading-scanline {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  transform: translateY(-50%);
  background: rgba(232, 234, 235, 0.72);
  box-shadow: 0 0 20px rgba(232, 234, 235, 0.2);
}

.loading-face-percent,
.loading-verified {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  transform: translate(-50%, -50%);
  margin: 0;
  padding: 0 16px;
  background: var(--background);
  color: var(--secondary);
  font-family: Orbitron, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 2px;
  text-transform: uppercase;
  white-space: nowrap;
  transition: opacity 220ms ease;
}

.loading-verified {
  opacity: 0;
}

.loading-overlay.is-verified .loading-face-percent {
  opacity: 0;
}

.loading-overlay.is-verified .loading-verified {
  opacity: 1;
}

.nodes-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

.nodes-canvas.is-morphing {
  transform: scale(var(--nodes-final-scale, 0.3));
}

.pentagon-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.pentagon-layer {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: 450px 310px;
  transform: scale(0.88) rotate(-5deg);
}

.department-page.is-ready .pentagon-layer {
  animation: pentagon-enter 1120ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.department-page.is-ready .layer-one {
  animation-delay: 450ms;
}

.department-page.is-ready .layer-two {
  animation-delay: 300ms;
}

.department-page.is-ready .layer-three {
  animation-delay: 150ms;
}

.department-page.is-ready .layer-four {
  animation-delay: 0ms;
}

.pentagon-layer polygon {
  fill: #ffffff;
}

.layer-one polygon { fill-opacity: 0.10; }
.layer-two polygon { fill-opacity: 0.14; }
.layer-three polygon { fill-opacity: 0.18; }
.layer-four polygon { fill-opacity: 0.24; }

.dept-label {
  position: absolute;
  display: block;
  opacity: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--secondary);
  font-family: Orbitron, sans-serif;
  font-size: 16px;
  line-height: 1;
  letter-spacing: 2px;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: default;
  pointer-events: none;
  transform: translate3d(var(--label-anchor-x, 0), var(--label-anchor-y, 0), 0) translateY(14px);
  transition: opacity 720ms cubic-bezier(0.22, 1, 0.36, 1), transform 720ms cubic-bezier(0.22, 1, 0.36, 1), color 150ms ease;
  will-change: opacity, transform;
}

.dept-label::before {
  content: "";
  position: absolute;
  display: block;
  inset: -18px -28px;
}

.dept-label > span {
  pointer-events: none;
}

.dept-wel::before {
  inset: -34px -96px -42px -44px;
}

.dept-label.is-ready {
  opacity: 1;
  cursor: pointer;
  pointer-events: auto;
  transform: translate3d(var(--label-anchor-x, 0), var(--label-anchor-y, 0), 0) translateY(0);
}

.dept-label:hover,
.dept-label:focus-visible,
.dept-label.is-hovered {
  color: var(--primary);
  outline: none;
}

.dept-hover-preview {
  position: absolute;
  left: calc(100% + 56px);
  top: 50%;
  width: 77px;
  height: 77px;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  z-index: 3;
  border-radius: 1.848px;
  transform: translateY(-50%) translateX(-8px) scale(0.98);
  transition: opacity 220ms ease, transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  will-change: opacity, transform;
}

.dept-lif .dept-hover-preview {
  right: calc(100% + 56px);
  left: auto;
  transform: translateY(-50%) translateX(8px) scale(0.98);
}

.dept-hover-lock {
  position: absolute;
  height: 77px;
}

.dept-lock-icon {
  position: absolute;
  left: calc(50% + 0.5px);
  top: 50%;
  width: 40px;
  height: 40px;
  transform: translate(-50%, -50%);
}

.dept-lock-body {
  position: absolute;
  left: 16.92%;
  top: 8.58%;
  width: 66.16%;
  height: 82.84%;
  max-width: none;
}

.dept-lock-keyhole {
  position: absolute;
  left: 45.83%;
  top: 58.13%;
  width: 8.34%;
  height: 16.08%;
  max-width: none;
}

.dept-label:hover .dept-hover-preview,
.dept-label:focus-visible .dept-hover-preview,
.dept-label.is-hovered .dept-hover-preview {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0) scale(1);
}

.onboard-badge {
  position: absolute;
  left: 50%;
  top: 48%;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 320px;
  height: 96px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--secondary);
  font-family: Orbitron, sans-serif;
  font-size: 10px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, calc(-50% + 28px)) scale(0.965);
  transition:
    border-color 220ms ease,
    box-shadow 220ms ease,
    opacity 520ms ease,
    transform 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

.onboard-badge::before {
  content: none;
}

.onboard-badge::after {
  content: none;
}

.onboard-badge span {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 188px;
  height: 28px;
  overflow: hidden;
  text-align: center;
  pointer-events: none;
  transform: scale(1);
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.onboard-badge span::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-100%);
}

.onboard-badge span::after {
  content: "";
  position: absolute;
  left: -10%;
  top: 0;
  width: 120%;
  height: 1px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow:
    0 0 12px rgba(255, 255, 255, 0.26),
    0 0 24px rgba(42, 138, 122, 0.16);
  opacity: 0;
  pointer-events: none;
}

.department-page.is-ready.is-onboarded .onboard-badge {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
  animation: onboard-badge-enter 980ms cubic-bezier(0.22, 1, 0.36, 1) 620ms both;
  transition-delay: 0ms;
}

.department-page.is-ready.is-onboarded .onboard-badge::before {
  animation: none;
}

.department-page.is-ready.is-onboarded .onboard-badge::after {
  animation: none;
}

.department-page.is-ready.is-onboarded .onboard-badge span::before {
  animation: onboard-badge-light-sweep 1500ms cubic-bezier(0.22, 1, 0.36, 1) 1300ms both;
}

.department-page.is-ready.is-onboarded .onboard-badge span::after {
  animation: onboard-badge-scan 1300ms ease-in-out 900ms both;
}

.department-page.is-ready.is-onboarded .onboard-badge:focus-visible,
.department-page.is-ready.is-onboarded .onboard-badge.is-hovered {
  outline: none;
  box-shadow: none;
  transform: translate(-50%, -50%) scale(1);
}

.department-page.is-ready.is-onboarded .onboard-badge:focus-visible span,
.department-page.is-ready.is-onboarded .onboard-badge.is-hovered span {
  transform: scale(1.06);
}

.dept-mete {
  left: 50%;
  top: 7.419%;
  --label-anchor-x: -50%;
  --label-anchor-y: -100%;
}

.dept-wel {
  left: 77.9%;
  top: 38.316%;
  --label-anchor-x: 0;
  --label-anchor-y: -50%;
}

.dept-lic {
  left: 67.244%;
  top: 88.33%;
  --label-anchor-x: 0;
  --label-anchor-y: 0;
}

.dept-lif {
  left: 32.756%;
  top: 88.33%;
  --label-anchor-x: -100%;
  --label-anchor-y: 0;
}

.dept-hael {
  left: 22.1%;
  top: 38.316%;
  --label-anchor-x: -100%;
  --label-anchor-y: -50%;
}

.department-detail-overlay {
  position: fixed;
  left: var(--detail-left, 50%);
  top: var(--detail-top, 50%);
  z-index: 28;
  width: 642px;
  height: 404px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  background: var(--background);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04),
    0 0 24px rgba(255, 255, 255, 0.08);
  color: var(--secondary);
  opacity: 0;
  pointer-events: none;
  transform: translate(var(--detail-x, -50%), calc(var(--detail-y, -50%) + 18px)) scale(0.965);
  transition: opacity 220ms ease, transform 340ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.department-detail-overlay[aria-hidden="true"] {
  visibility: hidden;
}

.department-detail-overlay.is-open {
  visibility: visible;
  opacity: 1;
  transform: translate(var(--detail-x, -50%), var(--detail-y, -50%)) scale(1);
}

.department-detail-overlay.is-from-mete {
  --detail-left: 50%;
  --detail-top: 25%;
  --detail-x: -50%;
  --detail-y: 0%;
}

.department-detail-overlay.is-from-wel {
  --detail-left: calc(50% + min(28vw, 360px));
  --detail-top: 50%;
  --detail-x: -50%;
  --detail-y: -50%;
}

.department-detail-overlay.is-from-hael {
  --detail-left: calc(50% - min(28vw, 360px));
  --detail-top: 50%;
  --detail-x: -50%;
  --detail-y: -50%;
}

.department-detail-overlay.is-from-lic {
  --detail-left: calc(50% + min(28vw, 360px));
  --detail-top: 76%;
  --detail-x: -50%;
  --detail-y: -100%;
}

.department-detail-overlay.is-from-lif {
  --detail-left: calc(50% - min(28vw, 360px));
  --detail-top: 76%;
  --detail-x: -50%;
  --detail-y: -100%;
}

.department-detail-heading {
  position: absolute;
  left: 55px;
  top: 31px;
  width: 432px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 2px;
}

.department-detail-heading p,
.department-detail-heading span,
.department-detail-copy {
  margin: 0;
}

.department-detail-heading p {
  font-family: Orbitron, sans-serif;
  font-size: 16px;
  text-transform: uppercase;
}

.department-detail-heading span {
  font-size: 16px;
}

.department-detail-media {
  position: absolute;
  left: -62px;
  top: 22px;
  width: 403px;
  height: 403px;
}

.department-detail-media > img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}

.department-detail-media > img[hidden] {
  display: none;
}


.department-detail-media.is-mete {
  left: 55px;
  top: 106px;
  width: 160px;
  height: 218px;
}

.department-detail-media.is-mete img {
  object-fit: contain;
}

.department-detail-media.is-hael {
  left: 55px;
  top: 106px;
  width: 160px;
  height: 208px;
}

.department-detail-media.is-hael img {
  object-fit: cover;
}

.department-detail-media.is-wel {
  left: 55px;
  top: 115px;
  width: 160px;
  height: 208px;
}

.department-detail-media.is-wel img {
  object-fit: contain;
}

.department-detail-media.is-muted {
  filter: grayscale(0.85);
  opacity: 0.42;
}

.department-detail-media.is-locked {
  left: 55px;
  top: 115px;
  width: 160px;
  height: 208px;
  overflow: hidden;
  border-radius: 4px;
}

.department-detail-lock {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 64px;
  height: 64px;
  display: none;
  transform: translate(-50%, -50%);
}

.department-detail-lock:not([hidden]) {
  display: block;
}

.department-detail-lock-body {
  position: absolute;
  left: 16.92%;
  top: 8.58%;
  width: 66.16%;
  height: 82.84%;
  max-width: none;
}

.department-detail-lock-keyhole {
  position: absolute;
  left: 45.83%;
  top: 58.13%;
  width: 8.34%;
  height: 16.08%;
  max-width: none;
}

.department-detail-copy {
  position: absolute;
  left: 258px;
  top: 181px;
  width: 321px;
  color: var(--secondary);
  font-size: 14px;
  line-height: 1.18;
  letter-spacing: 0;
  transform: none;
}

.department-detail-restricted-copy {
  position: absolute;
  left: 258px;
  top: 50%;
  width: 321px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  transform: translateY(calc(-50% + 18px));
}

.department-detail-restricted-copy[hidden] {
  display: none;
}

.department-detail-restricted-heading,
.department-detail-restricted-body {
  margin: 0;
  color: var(--secondary);
  line-height: 1;
}

.department-detail-restricted-heading {
  font-size: 16px;
  letter-spacing: 2px;
}

.department-detail-restricted-body {
  font-size: 14px;
  letter-spacing: 0;
  line-height: 1.18;
}

.restricted-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.88);
  opacity: 0;
  transition: opacity 240ms ease;
}

.restricted-overlay.is-open {
  opacity: 1;
}

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

.restricted-modal {
  position: relative;
  width: min(1200px, calc(100vw - 48px), calc((100vh - 48px) * 1.5));
  aspect-ratio: 1200 / 800;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04),
    0 0 24px rgba(255, 255, 255, 0.08);
  background: var(--background);
  overflow: hidden;
  transform: scale(0.96);
  opacity: 0;
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1), opacity 220ms ease;
}

.restricted-overlay.is-open .restricted-modal {
  transform: scale(1);
  opacity: 1;
}

.restricted-heading {
  position: absolute;
  left: 4.917%;
  top: 7.125%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  color: var(--secondary);
}

.restricted-title,
.restricted-subtitle,
.restricted-copy,
.restricted-card p {
  margin: 0;
}

.restricted-title {
  font-family: Orbitron, sans-serif;
  font-size: clamp(18px, 2.667vw, 32px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: clamp(5px, 1.333vw, 16px);
  text-transform: uppercase;
  white-space: nowrap;
}

.restricted-subtitle {
  font-size: clamp(14px, 2vw, 24px);
  line-height: 1;
  letter-spacing: 2px;
}

.restricted-close {
  position: absolute;
  right: 5.083%;
  top: 7.125%;
  width: clamp(32px, 3.333vw, 40px);
  height: clamp(32px, 3.333vw, 40px);
  padding: 0;
  border: 1px solid #ffffff;
  border-radius: 4px;
  background: transparent;
  overflow: hidden;
  cursor: pointer;
  transition: background 150ms ease;
}

.restricted-close:hover,
.restricted-close:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

.restricted-close img {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12.5px;
  height: 12.5px;
  max-width: none;
  transform: translate(-50%, -50%);
  filter: brightness(0) invert(1);
}

.restricted-content {
  position: absolute;
  left: 50%;
  top: 32%;
  width: 90%;
  max-width: calc(100% - 120px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  transform: translateX(-50%);
}

.restricted-card {
  position: relative;
  width: min(489px, 45.278%);
  aspect-ratio: 489 / 372;
  min-width: 280px;
  height: auto;
  max-width: 100%;
  background: rgba(232, 234, 235, 0.1);
}

.restricted-card p,
.restricted-copy {
  color: var(--primary);
  font-size: clamp(11px, 1.333vw, 16px);
  line-height: 1;
  letter-spacing: 2px;
  white-space: nowrap;
}

.restricted-card p {
  position: absolute;
  left: calc(50% + 0.5px);
  top: calc(50% + 32px);
  font-size: clamp(12px, 1.333vw, 16px);
  transform: translateX(-50%);
}

.restricted-lock-icon {
  position: absolute;
  left: calc(50% + 0.5px);
  top: calc(50% - 19px);
  width: 40px;
  height: 40px;
  transform: translate(-50%, -50%);
}

@keyframes cursor-blink {
  0%,
  45% {
    opacity: 1;
  }

  46%,
  100% {
    opacity: 0;
  }
}

@keyframes face-scan-sweep {
  from {
    transform: translateY(0);
  }

  to {
    transform: translateY(40vh);
  }
}

@keyframes onboard-badge-enter {
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes onboard-badge-scan {
  0% {
    top: 0;
    opacity: 0;
  }

  12%,
  82% {
    opacity: 1;
  }

  100% {
    top: 100%;
    opacity: 0;
  }
}

@keyframes onboard-badge-light-sweep {
  0% {
    opacity: 0;
    transform: translateX(-100%);
  }

  35% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translateX(100%);
  }
}

@keyframes pentagon-enter {
  0% {
    opacity: 0;
    transform: scale(0.88) rotate(-5deg);
  }

  45% {
    opacity: 1;
  }

  to {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

@media (max-width: 760px) {
  .dept-nav {
    padding: 18px 20px;
  }

  .dept-logo {
    gap: 14px;
  }

  .dept-logo span {
    font-size: 12px;
    letter-spacing: 7px;
  }

  .employee p {
    font-size: 12px;
  }

  .dept-main {
    padding: 28px 22px;
  }

  .dept-label {
    font-size: 11px;
    letter-spacing: 1px;
  }

  .restricted-modal {
    width: calc(100vw - 48px);
  }

  .restricted-title {
    max-width: 72vw;
  }

  .department-detail-overlay {
    width: calc(100vw - 32px);
    height: auto;
    aspect-ratio: 642 / 404;
    transform: translate(-50%, -47%) scale(0.94);
  }

  .department-detail-overlay.is-open {
    transform: translate(-50%, -50%) scale(0.94);
  }
}

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

  .map-stage {
    transform: none;
  }
}
