:root {
  --color--black: #2d2d2d;
  --color--white: #ffffff;
  --color--flag-red: #EF434C;
  --color--flag-blue: #47B3DD;
  --color--flag-gray: #B6B6B6;

  --x-margin: max(1.5rem, max(6.25vw, calc((100vw - 1120px) / 2)));
  --max-width: calc(100vw - var(--x-margin) * 2);

  font-size: clamp(0.875rem, 1.25vw, 1rem);
}

@media (max-width: 768px) {
  :root {
    font-size: 16px;
  }
}

h1, h2, h3, h4, h5, h6, p, ul, ol, li {
  margin: 0;
}

a {
  color: inherit;
  text-underline-offset: .375em;
}

button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: inherit;
}

:where(nav) :where(ul, li) {
  list-style: none;
  padding: 0;
  margin: 0;
}
:where(header, footer, nav) :where(a) {
  text-decoration: none;
  color: inherit;
  white-space: nowrap;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 2rem;
}

body {
  margin: 0;
  padding: 0;
  font-family: "Inter", "Noto Sans JP", sans-serif;
  font-optical-sizing: auto;
  --webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--color--black);
  color: var(--color--white);
}

#loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color--black);
  z-index: 9999;
}
#loader::after {
  content: "";
  display: block;
  width: 3rem;
  height: 3rem;
  border: 0.25rem solid var(--color--white);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

:where(.fonts-loaded, .fonts-failed) #loader {
  visibility: hidden;
  opacity: 0;
  transition: visibility 0s linear 0.3s, opacity 0.3s ease;
}

/* Global Header */

#globalHeader {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  height: 0;
  color: var(--color--white);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
}
.header-inner .logo {
  position: relative;
  z-index: 100;
  margin: 0;
  filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.25));
}

/* Global Navigation */

:where(.global-nav, .global-nav ul) {
  display: flex;
  align-items: center;
  gap: 2rem;
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1;
}
.global-nav :is(a, span):not([href*="contact"]) {
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.25);
  padding: 1em 0;
}
.global-nav a[href*="contact"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color--white);
  color: var(--color--black);
  min-width: 8rem;
  padding: calc(.75rem - .5em) 0;
  border-radius: 9999px;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.25);
}
.global-nav .language {
  gap: 0;
}
.global-nav .language span {
  opacity: 0.5;
}
.global-nav .language li:first-child:after {
  content: "";
  display: inline-block;
  height: 1em;
  vertical-align: -.125em;
  border-left: 1px solid currentColor;
  margin: 0 .75rem;
  transform: skewX(-30deg);
  opacity: 0.5;
}

.menu-toggle {
  display: none;
}
.menu-icon {
  position: relative;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  width: 1.25rem;
  height: 1rem;
  
}
.menu-icon .bar {
  width: 100%;
  height: 12.5%;
  background-color: var(--color--white);
  position: relative;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.25);
}

@media (max-width: 768px) {
  .global-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color--black);
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s linear 0.3s, opacity 0.3s ease;
  }
  :where(.global-nav, .global-nav ul:not(.language)) {
    flex-direction: column;
    justify-content: center;
    gap: 3rem;
  }
  .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.375rem;
    height: 3.375rem;
    position: fixed;
    z-index: 1000;
    top: 0;
    right: 0;
  }
  .menu-toggle.active ~ .global-nav {
    visibility: visible;
    opacity: 1;
    transition: visibility 0s linear 0s, opacity 0.3s ease
  }
  .menu-icon .bar {
    transition: transform 0.3s ease, opacity 0.3s ease, 
                top 0.3s ease, width 0.3s ease;
  }
  .menu-toggle.active  .menu-icon .bar:nth-child(1) {
    top: 43.75%;
    transform: rotate(45deg);
  }
  .menu-toggle.active  .menu-icon .bar:nth-child(2) {
    opacity: 0;
  }
  .menu-toggle.active  .menu-icon .bar:nth-child(3) {
    top: -43.75%;
    transform: rotate(-45deg);
  }
}

/* Global Footer */

#globalFooter {
  background-color: var(--color--white);
  color: var(--color--black);
  border-bottom: 8px solid var(--color--black);
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1rem 2rem;
  row-gap: 3rem;
}
.footer-inner .logo {
  margin-top: 2.5rem;
}
.footer-inner a[href*="privacypolicy"] {
  font-size: .875rem;
  text-decoration: underline;
}
.footer-inner .copyright {
  font-size: .75rem;
  line-height: 1.5;
}

/* Social Accounts */

.socialAccounts {
  display: flex;
  flex-direction: column;
  align-items: center;
  row-gap: 1.5rem;
}
.socialAccounts h3 {
  margin: 0;
  font-size: .875rem;
  font-weight: 600;
}
.socialAccounts ul {
  display: flex;
  align-items: center;
  gap: 1rem;
}
