@font-face {
  font-family: 'Epkaisho';
  src: url('/public/epkaisho.ttf') format('truetype');
  font-display: swap;
}

/* Basic box sizing and global font family */
* {
  font-family: 'Epkaisho', -apple-system, BlinkMacSystemFont, 'Segoe UI',
    'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans',
    'Helvetica Neue', sans-serif !important;
  box-sizing: border-box;
}

* {
  background: transparent !important;
  color: inherit !important;
  border: none !important;
  filter: none !important;
  text-shadow: none !important;
  transition: none !important;
  animation: none !important;
  outline: none !important;
}

html {
  background: #000 !important;
  color: #fff !important;
  min-height: 100%;
  overflow-x: hidden;
}

body {
  background: #000 !important;
  color: #fff !important;
  line-height: 1.7;
  margin: 0;
  min-height: 100vh;
  padding: 0 12px;
  overflow-x: hidden;
}

/* Hide vertical scrollbar for the whole page and set overflow */
html, body {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
  overflow-y: scroll !important;
  overscroll-behavior: none;
}
body::-webkit-scrollbar, html::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  background: transparent !important;
}
body {
  overflow-x: hidden !important;
}

main, header, footer {
  overflow-wrap: break-word;
  word-break: break-word;
}

body:not(.assets-ready) > *:not(.loader-wrap) {
  display: none !important;
}

.loader-wrap {
  width: 100vw;
  height: 100vh;
  display: flex !important;
  align-items: center;
  justify-content: center;
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  background: #000;
  z-index: 9999;
}

body.assets-ready .loader-wrap {
  display: none !important;
}

.dots-loading {
  font-size: 2.5rem;
  color: #fff;
  letter-spacing: 2px;
  user-select: none;
  display: flex;
  align-items: center;
}

.dots {
  margin-left: 8px;
  font-size: 2.5rem;
  letter-spacing: 2px;
  min-width: 5ch;
  display: inline-block;
}

.blink-cursor {
  display: inline-block;
  margin-left: 3px;
  width: 1ch;
  color: #fff;
  animation: dotblink 0.9s steps(1) infinite;
}

@keyframes dotblink {
  0% {
    opacity: 1;
  }
  49% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
  99% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

/* Base layout */
header {
  max-width: 900px;
  margin: 0 auto 48px auto;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 16px;
  padding-top: 42px !important;
  padding-bottom: 42px !important;
  border-bottom: 1px solid #fff !important;
  opacity: 0.74;
}

header a {
  color: #aaa;
  text-decoration: none;
  background: none;
  filter: none;
}

header a:hover {
  color: #fff;
  background: #181818;
  filter: none;
}

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 0;
  display: block;
  min-height: 400px;
}

/* Headings */
h1,
h2,
h3,
h4,
h5,
h6 {
  color: #fff;
  font-weight: 500;
  margin-top: 32px;
  margin-bottom: 10px;
  padding: 0;
}

h1,
h2,
h3 {
  font-weight: 500;
  margin-top: 50px;
}

/* Paragraphs, lists, tables, quotes */
p,
ul,
ol,
li,
blockquote,
table,
th,
td {
  color: #fff;
  margin: 0 0 18px 0;
  padding: 0;
  background: none;
}

p {
  margin: 18px 0;
}

/* Code blocks */
pre,
code {
  background: #181818 !important;
  color: #fff !important;
  font-family: inherit;
  font-size: 14px;
  margin: 0 0 14px 0;
  padding: 8px;
  border-radius: 3px;
}

pre {
  overflow-x: auto;
  white-space: pre;
}

code {
  word-break: break-word;
}

p code {
  background: #232323 !important;
  color: #fff !important;
  padding: 2px 6px !important;
  border-radius: 3px !important;
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 20px 0;
  background: #000 !important;
  filter: grayscale(100%) !important;
  border-radius: 2px;
}

/* Blockquotes */
blockquote {
  border-left: 2px solid #444;
  padding-left: 16px;
  opacity: 0.95;
  background: none;
  color: #fff;
}

/* Tables */
table {
  border-collapse: collapse;
  width: 100%;
  margin: 22px 0;
  background: none;
}

th,
td {
  border: 1px solid #222;
  padding: 8px;
  background: #000;
  color: #fff;
}

/* Selection */
::selection {
  background: #fff !important;
  color: #000 !important;
}

/* Footer */
footer {
  max-width: 900px;
  margin: 40px auto 0 auto;
  padding: 12px 0;
  color: #fff !important;
  font-size: 12px;
  text-align: right;
  opacity: 0.74;
  border-top: 1px solid #fff !important;
  letter-spacing: 1px;
  font-family: inherit;
}

/* --- Responsive: Phone UI --- */
@media (max-width: 600px) {
  html,
  body {
    min-width: 0;
    min-height: 100vh;
    width: 100%;
    height: 100vh !important;
    font-size: 16px;
    line-height: 1.65;
    padding-left: 12px !important;
    padding-right: 12px !important;
    overflow-x: hidden !important;
    box-sizing: border-box;
  }

  /* Reduce container max-width and spacing for mobile */
  header,
  main,
  footer {
    max-width: 100vw !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
    box-sizing: border-box;
  }

  header {
    margin: 0 0 32px 0 !important;
    gap: 10px !important;
    font-size: 13px !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    padding-top: 32px !important;
    padding-bottom: 32px !important;
    border-bottom: 1px solid #fff !important;
  }

  main {
    margin: 0 !important;
    min-height: 240px !important;
    padding: 0 !important;
  }

  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    margin-top: 22px !important;
    margin-bottom: 8px !important;
    font-size: 1.36rem !important;
    line-height: 1.1 !important;
  }
  h1,
  h2,
  h3 {
    margin-top: 36px !important;
    font-size: 1.5rem !important;
    line-height: 1.15 !important;
  }
  p,
  ul,
  ol,
  li,
  blockquote,
  table,
  th,
  td {
    margin: 0 0 13px 0 !important;
    font-size: 1rem !important;
  }
  p {
    margin: 13px 0 !important;
  }
  pre,
  code {
    font-size: 13px !important;
    padding: 7px !important;
    margin: 0 0 10px 0 !important;
    word-break: break-all !important;
    white-space: pre-wrap !important;
  }
  img {
    margin: 12px 0 !important;
    border-radius: 2px !important;
  }
  blockquote {
    padding-left: 10px !important;
    font-size: 0.98rem !important;
  }
  table {
    margin: 16px 0 !important;
    font-size: 0.98rem !important;
    overflow-x: auto;
    display: block;
    width: 100% !important;
  }
  th,
  td {
    padding: 6px !important;
    font-size: 0.98rem !important;
  }
  footer {
    margin: 24px 0 0 0 !important;
    padding: 8px 0 !important;
    font-size: 10px !important;
    text-align: left !important;
    border-top: 1px solid #fff !important;
    letter-spacing: 0.5px !important;
  }
  .dots-loading,
  .dots {
    font-size: 1.3rem !important;
    min-width: 2ch !important;
    margin-left: 4px !important;
  }
}

/* Accessibility and print/transparent resets */
* {
  background: transparent !important;
  color: inherit !important;
  box-sizing: border-box !important;
  border: none !important;
  filter: none !important;
  text-shadow: none !important;
  transition: none !important;
  animation: none !important;
  outline: none !important;
  font-family: 'Epkaisho', -apple-system, BlinkMacSystemFont, 'Segoe UI',
    'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans',
    'Helvetica Neue', sans-serif !important;
}

/* Link styling */
a,
a:visited,
a:active {
  color: #bbb !important;
  text-decoration: none !important;
  background: #000 !important;
  box-shadow: none !important;
  word-break: break-all !important;
  overflow-wrap: anywhere !important;
  filter: none !important;
  border-bottom: 1px solid transparent !important;
  padding-bottom: 3px !important;
  transition: color 0.2s, border-color 0.2s !important;
}

/* Hover, focus: lighten to full white and underline lightens */
a:hover,
a:focus {
  color: #fff !important;
  border-bottom: 1px solid #fff !important;
  text-decoration: none !important;
}

/* Custom scroll percent bar */
#scroll-percent-bar {
  position: fixed;
  right: 32px;
  bottom: 12px;
  z-index: 9999;
  color: #fff;
  font-family: inherit;
  font-size: 18px;
  padding: 4px 32px;
  pointer-events: none;
  user-select: none;
  letter-spacing: 0.03em;
}

/* Animate fadein/out if needed */
#scroll-percent-bar.hidden {
  opacity: 0;
  transition: opacity 0.4s cubic-bezier(0.44,0,0.56,1);
}
