:root {
  --bg: #060816;
  --text: #f6f7fb;
  --muted: #a8b0d0;
  --cyan: #85f7ff;
  --lime: #d8ff62;
  --red: #ff5f87;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 95, 135, 0.18), transparent 30%),
    radial-gradient(circle at 80% 10%, rgba(133, 247, 255, 0.15), transparent 25%),
    radial-gradient(circle at 50% 80%, rgba(216, 255, 98, 0.12), transparent 30%),
    linear-gradient(135deg, #04050d 0%, #091020 48%, #03060f 100%);
  color: var(--text);
  font-family: "Noto Sans TC", sans-serif;
}

body {
  overflow-x: hidden;
}

body.modal-open {
  overflow: hidden;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.08;
  background-image:
    linear-gradient(transparent 0 49%, rgba(255, 255, 255, 0.45) 50%, transparent 51%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
  background-size: 100% 4px, 24px 24px;
  mix-blend-mode: screen;
}

.page-shell {
  position: relative;
  width: min(1040px, calc(100% - 40px));
  margin: 0 auto;
  padding: 56px 0 80px;
}

.hero {
  position: relative;
  padding: 28px 0 72px;
}

.hero h1,
.section-heading h2 {
  margin: 0;
  font-family: "Orbitron", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero h1 {
  max-width: 9ch;
  font-size: clamp(2.6rem, 6vw, 4.8rem);
  line-height: 0.98;
  text-shadow:
    0 0 20px rgba(133, 247, 255, 0.32),
    4px 4px 0 rgba(255, 95, 135, 0.28);
}

.hero::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 28px;
  width: min(240px, 60vw);
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), transparent);
  box-shadow: 0 0 24px rgba(133, 247, 255, 0.45);
}

.eyebrow {
  margin: 0 0 18px;
  font-family: "Orbitron", sans-serif;
  font-size: 0.82rem;
  letter-spacing: 0.4em;
  color: var(--lime);
}

.hero-copy,
.section-heading p {
  max-width: 640px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.75;
}

.engineer-section {
  position: relative;
  padding: 0;
}

.section-heading {
  padding: 0 0 20px;
}

.section-heading h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
}

.engineer-grid {
  display: grid;
  gap: 20px;
}

.tier-card {
  position: relative;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015)),
    rgba(4, 8, 22, 0.72);
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.tier-s {
  box-shadow:
    inset 0 0 0 1px rgba(216, 255, 98, 0.18),
    0 24px 60px rgba(0, 0, 0, 0.28);
}

.tier-a {
  box-shadow:
    inset 0 0 0 1px rgba(133, 247, 255, 0.14),
    0 24px 60px rgba(0, 0, 0, 0.28);
}

.tier-b {
  box-shadow:
    inset 0 0 0 1px rgba(255, 95, 135, 0.16),
    0 24px 60px rgba(0, 0, 0, 0.28);
}

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

.tier-label {
  margin: 0 0 10px;
  font-family: "Orbitron", sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.4em;
  color: var(--cyan);
}

.tier-header h3,
.modal-copy h3 {
  margin: 0;
  font-family: "Orbitron", sans-serif;
}

.tier-header h3 {
  font-size: clamp(1.15rem, 2.4vw, 1.6rem);
}

.tier-description {
  max-width: 360px;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 0.95rem;
}

.tier-members {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 18px;
  align-items: flex-start;
}

.engineer-card {
  position: relative;
  width: min(100%, 180px);
  flex: 0 0 180px;
  min-height: 100%;
}

.tier-members.is-single .engineer-card {
  width: min(100%, 170px);
  flex-basis: 170px;
}

.engineer-trigger {
  width: 100%;
  min-height: 100%;
  padding: 6px 0 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
  transition:
    transform 180ms ease,
    filter 180ms ease;
}

.engineer-trigger:hover,
.engineer-trigger:focus-visible {
  transform: translateY(-4px);
  filter: brightness(1.05);
}

.engineer-trigger:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 8px;
  border-radius: 24px;
}

.avatar-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  margin-bottom: 12px;
  border-radius: 999px;
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 30%, rgba(133, 247, 255, 0.4), transparent 30%),
    linear-gradient(135deg, rgba(255, 95, 135, 0.22), rgba(133, 247, 255, 0.16));
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 0 30px rgba(133, 247, 255, 0.18);
}

.avatar-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(1.05) contrast(1.08);
}

.engineer-name {
  margin: 0 0 4px;
  font-size: 0.98rem;
  font-weight: 700;
  text-align: center;
}

.engineer-rank {
  margin: 0;
  text-align: center;
  color: var(--lime);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.engineer-tag {
  margin: 8px auto 0;
  max-width: 20ch;
  font-size: 0.86rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
}

.engineer-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 180ms ease,
    visibility 180ms ease;
}

.engineer-modal[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 4, 12, 0.78);
  backdrop-filter: blur(10px);
}

.modal-panel {
  position: relative;
  width: min(760px, 100%);
  max-height: min(84vh, 720px);
  overflow: auto;
  padding: 22px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at top right, rgba(255, 95, 135, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(9, 16, 32, 0.96), rgba(5, 9, 20, 0.98));
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.modal-close {
  position: sticky;
  top: 0;
  margin-left: auto;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 1.35rem;
  cursor: pointer;
}

.modal-hero {
  display: grid;
  grid-template-columns: minmax(180px, 220px) 1fr;
  gap: 22px;
  align-items: center;
}

.modal-avatar {
  aspect-ratio: 1;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(255, 95, 135, 0.24), rgba(133, 247, 255, 0.16));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 24px 50px rgba(0, 0, 0, 0.3);
}

.modal-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.modal-tier {
  margin: 0 0 10px;
  color: var(--cyan);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-size: 0.82rem;
}

.modal-copy h3 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}

.modal-title {
  margin: 10px 0 0;
  color: var(--lime);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.82rem;
}

.modal-downfall {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.75;
}

.modal-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.modal-stats span {
  padding: 8px 12px;
  border: 1px solid rgba(133, 247, 255, 0.22);
  border-radius: 999px;
  background: rgba(133, 247, 255, 0.06);
  color: var(--text);
  font-size: 0.84rem;
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 20px, 1180px);
    padding: 24px 0 56px;
  }

  .hero {
    padding: 32px 0 64px;
  }

  .eyebrow {
    letter-spacing: 0.26em;
  }

  .tier-card,
  .modal-panel {
    padding: 18px;
    border-radius: 18px;
  }

  .tier-header,
  .modal-hero {
    grid-template-columns: 1fr;
  }

  .tier-members {
    gap: 16px 14px;
  }

  .engineer-card,
  .tier-members.is-single .engineer-card {
    width: min(100%, 148px);
    flex-basis: 148px;
  }

  .tier-header {
    align-items: start;
  }

  .modal-close {
    width: 36px;
    height: 36px;
  }
}
