#container {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  max-width: 1800px;
  margin: 0 auto;
}

header {
  position: fixed;
  top: 30px;
  left: 16px;
  right: 16px;
  z-index: 9999;
  display: flex;
  align-items: center;
  width: auto;
  height: 70px;
  margin: 0;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32);
  background: var(--header-gradient);
  backdrop-filter: blur(6px);
}

body:not(.home) header {
  background: var(--header-gradient-alt);
}

.flex-container {
  display: block;
}

.flex-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
}

.flex-row:has(.top-space) {
  align-items: center;
}

.flex-item {
  flex: 0 0 50%;
  min-width: 0;
  padding: 10px;
  box-sizing: border-box;
}

@media screen and (min-width: 1200px) and (max-width: 1439px) {
  .flex-row .flex-item:has(.imgg),
  .flex-row .flex-item:has(.iframe-wrapper) {
    flex: 0 1 40%;
  }

  .flex-row .flex-item:has(table),
  .flex-row .flex-item:has(p.top-space) {
    flex: 1 1 60%;
  }

  .flex-row:has(.iframe-wrapper) .flex-item:has(.iframe-wrapper) {
    flex: 0 0 50%;
  }

  .flex-row:has(.iframe-wrapper) .flex-item:has(p.top-space) {
    flex: 1 1 50%;
  }

  .flex-row:has(.iframe-wrapper) {
    align-items: center;
  }

  .flex-row:has(.iframe-wrapper) .flex-item > p.top-space {
    margin-top: 0 !important;
    font-size: 0.9em;
    line-height: 1.55;
  }
}

.imgg {
  text-align: center;
}

.iframe-wrapper {
  position: relative;
  height: 0;
  overflow: hidden;
  padding-bottom: 56.25%;
}

.iframe-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

@media screen and (max-width: 599px) {
  header {
    top: 30px;
  }

  .s #menubar.d-b {
    width: calc(100% - 8px);
    max-width: none;
  }

  .flex-row {
    display: block;
  }

  .flex-item {
    width: 100%;
  }
}

#logo img {
  display: block;
}

#logo {
  width: 190px;
  flex-shrink: 0;
}

#menubar a {
  display: block;
  text-decoration: none;
}

#menubar ul {
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: inherit;
}

#menubar.d-n,
#menubar_hdr.d-n,
#menubar .ddmenu_parent ul {
  display: none;
}

#menubar.d-b {
  display: block;
}

#menubar_hdr.d-b {
  display: flex;
}

#menubar {
  position: relative;
  z-index: 1;
  flex: 1;
  min-width: 0;
  margin-left: clamp(12px, 1.8vw, 28px);
  font-size: 18px;
}

#menubar .ddmenu {
  cursor: default;
}

a.ddmenu::before {
  content: "▾";
  display: inline-block;
  margin-right: 0.5em;
  font-weight: bold;
  transform: none;
}

.p #menubar > nav > ul {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-left: 0;
  font-size: clamp(0.86rem, 0.74rem + 0.42vw, 1.12rem);
  letter-spacing: clamp(0.02em, 0.08vw, 0.1em);
}

.p #menubar a {
  padding: 10px clamp(3px, 0.9vw, 16px);
  white-space: nowrap;
}

.p #menubar > nav > ul > li > a {
  position: relative;
  font-weight: 400;
  color: #f7fbff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  transition:
    color 0.25s ease,
    text-shadow 0.25s ease,
    transform 0.25s ease;
}

.p #menubar > nav > ul > li > a::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 4px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, #2e91ff, #53d6ff);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.25s ease;
}

.p #menubar > nav > ul > li > a:hover {
  color: #80d8ff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  transform: translateY(-1px);
}

.p #menubar > nav > ul > li > a:hover::after,
.p #menubar > nav > ul > li.current > a::after {
  transform: scaleX(1);
}

.p #menubar > nav > ul > li.current > a {
  color: #5dc7ff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.p #menubar ul ul {
  position: absolute;
  z-index: 100;
  overflow: hidden;
  border-radius: 10px;
  text-align: center;
  color: var(--text-on-dark);
  background: var(--header-gradient);
}

.p #menubar ul ul a {
  padding: 10px 20px;
  color: inherit;
  background: transparent;
}

.p #menubar ul ul a:hover {
  background: var(--header-gradient-alt);
}

.s #menubar.d-b {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  right: 0;
  z-index: 10000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: visible;
  width: min(calc(100% - 12px), 560px);
  max-height: min(72dvh, calc(100dvh - 140px));
  margin: 0 auto;
  padding: 16px;
  box-sizing: border-box;
  color: #fff;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 28px;
  background: linear-gradient(
    180deg,
    rgba(7, 16, 27, 0.94),
    rgba(8, 18, 31, 0.9)
  );
  backdrop-filter: blur(10px);
  box-shadow: 0 26px 54px rgba(0, 0, 0, 0.3);
  transform: none;
  animation: menubar-panel-in 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.s #menubar.d-b.is-closing {
  animation: menubar-panel-out 0.24s ease both;
}

.s #menubar {
  margin-left: 0;
  flex: none;
  min-width: auto;
}

.s #menubar nav {
  width: 100%;
  margin: 0;
  max-height: min(calc(72dvh - 32px), calc(100dvh - 172px));
  padding: 10px;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
}

.s #menubar > nav > ul {
  display: grid;
  gap: 8px;
}

.s header {
  overflow: visible;
}

.s #menubar > nav > ul > li {
  list-style: none;
}

.s #menubar a {
  display: block;
  padding: 12px 14px;
  color: inherit;
  font-size: 1.22rem;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: 0.04em;
  text-align: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.s #menubar > nav > ul > li > a {
  color: #f7fbff;
}

.s #menubar > nav > ul > li.current > a {
  background: rgba(93, 199, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(93, 199, 255, 0.26);
}

.s #menubar .ddmenu_parent ul {
  display: grid;
  gap: 4px;
  margin-top: 6px;
}

.s #menubar .ddmenu_parent ul a {
  padding: 10px 12px;
  font-size: 1.16rem;
  font-weight: 600;
  line-height: 1.45;
  background: rgba(255, 255, 255, 0.04);
}

.s a.ddmenu::before {
  content: "▾";
  margin-right: 0.45em;
  font-weight: 700;
  transform: none;
}

@keyframes menubar-panel-in {
  from {
    opacity: 0;
    transform: translateX(-28px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes menubar-panel-out {
  from {
    opacity: 1;
    transform: translateX(0);
  }

  to {
    opacity: 0;
    transform: translateX(28px);
  }
}

#menubar_hdr {
  position: fixed;
  top: 12px;
  right: 20px;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 46px;
  height: 46px;
  padding: 16px 14px;
  box-sizing: border-box;
  overflow: visible;
  cursor: pointer;
}

#menubar_hdr::before,
#menubar_hdr::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22px;
  border-top: 2px solid #eee;
  opacity: 0;
  transform-origin: center center;
  transition:
    opacity 0.3s,
    transform 0.3s;
}

@media screen and (min-width: 900px) {
  #menubar_hdr {
    top: 40px;
    right: 40px;
  }
}

#menubar_hdr span {
  display: block;
  border-top: 2px solid #eee;
  transition: 0.3s;
}

#menubar_hdr.ham span:nth-of-type(1),
#menubar_hdr.ham span:nth-of-type(3) {
  opacity: 0;
}

#menubar_hdr.ham::before,
#menubar_hdr.ham::after {
  opacity: 1;
}

#menubar_hdr.ham::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

#menubar_hdr.ham::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

#menubar_hdr.ham span:nth-of-type(2) {
  opacity: 0;
}

#contents {
  flex: 1;
  padding: 30px;
}

body:not(.home) #contents {
  padding-top: 150px;
}

@media screen and (max-width: 899px) {
  #menubar_hdr {
    top: 44px;
    right: 30px;
    width: 48px;
    height: 48px;
    padding: 13px 12px;
  }

  #contents {
    padding: 10px;
  }

  body:not(.home) #contents {
    padding-top: 100px;
  }
}

main {
  margin: 0 3%;
}

main.column .main {
  margin-bottom: 30px;
}

#contents h2 {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 0 1rem;
  font-size: 1.3rem;
  font-weight: normal;
  border-bottom: 2px solid #555;
}

#contents h2 .uline {
  position: relative;
  bottom: -2px;
  display: inline-block;
  padding: 10px 1rem;
  border-bottom: 2px solid var(--accent-bright);
}

#contents h2 .small {
  margin-right: 1rem;
  font-size: 0.6em;
  opacity: 0.7;
}

#contents h3 {
  margin: 0 0 1rem;
  padding: 10px 1rem;
  font-size: 1.3rem;
  font-weight: normal;
  border-bottom: 2px solid #555;
}

#contents table {
  margin: 3px auto;
}

#contents td,
#contents th {
  border: solid 1px;
}

#contents h4 {
  color: #000;
}

#contents p {
  margin: 0 1rem 2rem;
  color: var(--text-base);
}

#contents p + p {
  margin-top: -1rem;
}

.pagetop-show {
  display: block;
}

.pagetop a {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 99;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 50%;
}

.pagetop a::before {
  content: "↑";
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
  transform: translateY(-1px);
}

.pagetop a i {
  display: none;
}

#footermenu {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin: 0;
  padding: 0;
  font-size: 0.94rem;
  text-align: center;
  list-style: none;
}

#footermenu li {
  display: block;
}

#otoi p {
  margin: 0;
  line-height: 1.6;
}

footer small {
  display: block;
  font-size: 0.9rem;
  color: rgba(247, 251, 255, 0.72);
}

footer {
  width: 100vw;
  max-width: none;
  margin-top: 32px;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding: 24px 14px 20px;
  color: #f7fbff;
  font-size: 0.9rem;
  text-align: center;
  background: var(--header-gradient-alt);
}

footer,
footer * {
  box-sizing: border-box;
}

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

#footermenu li a {
  position: relative;
  display: inline-block;
  padding: 8px 10px;
  color: #f7fbff;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  transition:
    color 0.25s ease,
    text-shadow 0.25s ease,
    transform 0.25s ease;
}

#footermenu li a::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 4px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, #2e91ff, #53d6ff);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.25s ease;
}

#footermenu li a:hover {
  color: #80d8ff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  transform: translateY(-1px);
}

#footermenu li a:hover::after,
#footermenu li.current a::after {
  transform: scaleX(1);
}

#footermenu li.current a {
  color: #5dc7ff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

#otoi {
  width: 100%;
  max-width: 100%;
  margin: 0 auto 14px;
  padding: 12px 14px;
}

#otoi p + p {
  margin-top: 4px;
}

#otoi a {
  color: #8fe5ff;
  font-size: 1rem;
  overflow-wrap: anywhere;
}

#otoi a:hover {
  color: #ffffff;
}

@media screen and (min-width: 900px) {
  footer {
    margin-top: 40px;
    padding: 28px 20px 24px;
  }

  #footermenu {
    gap: 6px 12px;
    font-size: 1rem;
  }

  #footermenu li a {
    padding: 8px 12px;
  }

  #otoi {
    padding: 0;
  }
}

@media screen and (min-width: 900px) {
  header {
    left: 30px;
    right: 30px;
    padding: 0 30px;
  }

  #logo {
    width: 220px;
  }

  html,
  body {
    font-size: 16px;
  }

  main.column {
    display: flex;
    justify-content: space-between;
  }

  main.column .main {
    order: 2;
    width: calc(100% - 260px);
    margin-bottom: 0;
  }

  main.column .sub {
    order: 1;
    width: 230px;
  }
}

@media screen and (min-width: 900px) and (max-width: 1199px) {
  .p #menubar > nav > ul {
    font-size: clamp(0.72rem, 0.55rem + 0.35vw, 0.9rem);
  }
}
