/* ////////////////////////////////////////////////////////////
  共通
//////////////////////////////////////////////////////////// */

@import url("https://fonts.googleapis.com/css2?family=Noto+Serif+JP:wght@200..900&display=swap");
@import url('https://fonts.googleapis.com/css2?family=Zen+Kaku+Gothic+Antique&display=swap');

:root {
  --opa-1: 0.95;
  --color-bg: #141210;
  --text-white: #fff;
  --font-notoS: "Noto Serif JP", serif;
  --font-ZenKakuGothicA: "Zen Kaku Gothic Antique", sans-serif;
}

/* フォント（サブディレクトリ用の相対パス）*/
@font-face {
  font-family: "MZ-R";
  src: url(assets/fonts/PPEditorialOld-Regular.woff2) format("woff2"),
    url(assets/fonts/PPEditorialOld-Regular.woff) format("woff");
  font-weight: 300;
  font-display: swap;
  font-style: normal;
}
@font-face {
  font-family: "MZ-L";
  src: url(assets/fonts/PPEditorialOld-Ultralight.woff2) format("woff2"),
    url(assets/fonts/PPEditorialOld-Ultralight.woff) format("woff");
  font-weight: 300;
  font-display: swap;
  font-style: normal;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  background: var(--color-bg);
  scroll-behavior: auto;
}
body,
html {
  height: auto;
  margin: 0;
  padding: 0;
  color: var(--text-white);
  font-family: var(--font-notoS);
  overflow-x: hidden !important;
}
a {
  text-decoration: underline !important;
}
:lang(ja) {
  font-family: var(--font-notoS) !important;
  font-optical-sizing: auto;
  font-style: normal;
}

::selection {
  color: var(--color-bg);
}

#mouse-stalker,
.site-header,
.hero {
  pointer-events: none;
}

.site-header,
.hero {
  z-index: 1000;
  mix-blend-mode: overlay;
}

/* ////////////////////////////////////////////////////////////
  GoogleDocumentの呼び出しエリア
//////////////////////////////////////////////////////////// */

.doc-native-wrapper {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  opacity: 0;
  pointer-events: auto;
  margin: 4px;
  transition: opacity 1s ease-in-out;
}
.doc-native-wrapper.is-visible {
  opacity: var(--opa-1);
}

#native-doc {
  position: absolute;
  inset: 0px;
  display: block;
  overflow: auto;
  height: calc(100svh - 8px);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  transform: translateZ(0) scale(1.3);
  transform-origin: top center;
  transition: transform 0.4s ease;
}
#native-doc.is-flipped {
  transform: translateZ(0) scale(1.3) scaleX(-1);
}

#banners {
  display: none !important;
}
#contents {
  width: 100%;
  background-color: #fff;
}
#contents .doc-content {
  min-width: 100%;
  padding: 0 !important;
}
#contents .doc-content,
#contents .doc-content p,
#contents .doc-content p span,
#contents .doc-content h2 span {
  font-family: var(--font-ZenKakuGothicA) !important;
}

.doc-content p {
  line-height: 2.2em !important;
}

/* ////////////////////////////////////////////////////////////
  .site-header エリア
//////////////////////////////////////////////////////////// */

.site-header {
  padding-right: 1rem;
  position: fixed;
  top: 0;
  right: 0;
  font-weight: bold;
}
.site-header .container {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 1rem 0 1.1rem;
  font-size: 14px;
}

/* ////////////////////////////////////////////////////////////
  .hero エリア
//////////////////////////////////////////////////////////// */

.hero {
  position: relative;
  overflow: hidden;
}

.hero .branding {
  position: fixed;
  top: 4svh;
  left: 3%;
}

.site-title {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.site-title__main {
  font-family: var(--font-notoS);
  font-size: clamp(2rem, 4vw, 3.6rem);
  font-weight: 300;
  letter-spacing: 0.12em;
  line-height: 1.2;
  color: var(--text-white);
}
.site-title__sub {
  font-family: var(--font-notoS);
  font-size: clamp(0.85rem, 1.5vw, 1.1rem);
  font-weight: 300;
  letter-spacing: 0.3em;
  color: var(--text-white);
  opacity: 0.7;
}

/* スクロールインジケーター */
.hero .scroll {
  position: fixed;
  top: 50%;
  right: 0.5%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.scroll-indicator {
  position: relative;
  width: 11px;
  height: 180px;
  overflow: hidden;
}
.scroll-track {
  position: absolute;
  top: 0;
  left: 50%;
  width: 1px;
  height: 100%;
  background-color: var(--text-white);
  opacity: 0.3;
  transform: translateX(-50%);
}
.scroll-bar {
  position: absolute;
  top: 0;
  left: 50%;
  width: 1px;
  height: 100%;
  background-color: var(--text-white);
  transform: translate(-50%, -100%);
  animation: movescrollbar 2s infinite cubic-bezier(0.93, 0.04, 0.16, 0.9);
}
.scroll-bar::after {
  content: "";
  position: absolute;
  top: 100%;
  width: 5px;
  height: 5px;
  transform: translate(-42%, 0);
  border-radius: 50%;
  background-color: #fff;
}
@keyframes movescrollbar {
  0%   { transform: translate(-50%, -100%); }
  100% { transform: translate(-50%, -3%); }
}
.scroll-text {
  transform: rotate(90deg);
  font-size: 12px;
  margin-top: 10px;
  font-family: "MZ-R", serif;
  letter-spacing: 0.1em;
}

/* ////////////////////////////////////////////////////////////
  コントラストパネル
//////////////////////////////////////////////////////////// */

.doc-native-wrapper {
  mix-blend-mode: difference;
  isolation: isolate;
}

.doc-native-wrapper .doc-blend-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: #fff;
  mix-blend-mode: difference;
  pointer-events: none;
  opacity: var(--blend-alpha, 1);
  transition: opacity 0.22s ease;
}

.site-header,
.hero {
  transition: opacity 0.22s ease;
}

#lm-contrast-panel {
  position: fixed;
  bottom: 15svh;
  right: 3%;
  z-index: 2000;
  width: 160px;
  mix-blend-mode: normal !important;
  pointer-events: auto;
  color: inherit;
}

@media (max-height: 780px) {
  #lm-contrast-panel {
    bottom: 20svh;
  }
}

.lm-contrast__label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}
.lm-contrast__label-row label {
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1;
}
.lm-contrast__label-row output {
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

#lmContrastRange {
  width: 100%;
}

@keyframes kyoro {
  0%   { transform: scaleX(1); }
  20%  { transform: scaleX(-1); }
  40%  { transform: scaleX(1); }
  60%  { transform: scaleX(-1); }
  100% { transform: scaleX(1); }
}
#lm-contrast-panel .lm-contrast__label-row label[for="lmContrastRange"] {
  display: inline-block;
  transform-origin: 50% 50%;
  transition: transform 0.18s ease;
  cursor: pointer;
}
#lm-contrast-panel .lm-contrast__label-row label[for="lmContrastRange"].is-kyoro {
  animation: kyoro 0.8s ease-in-out;
}
#lm-contrast-panel .lm-contrast__label-row label[for="lmContrastRange"]:hover,
#lm-contrast-panel .lm-contrast__label-row label[for="lmContrastRange"]:focus-visible {
  animation: kyoro 0.6s ease-in-out;
}
@media (prefers-reduced-motion: reduce) {
  #lm-contrast-panel .lm-contrast__label-row label[for="lmContrastRange"] {
    transition: none;
    animation: none !important;
  }
}

:root {
  --contrast-percent: 100;
}
.doc-native-wrapper.is-visible {
  opacity: 1;
}

/* ////////////////////////////////////////////////////////////
  左右反転ボタン
//////////////////////////////////////////////////////////// */

#flip-btn {
  position: fixed;
  bottom: calc(15svh - 3.5rem);
  right: 3%;
  z-index: 2000;
  mix-blend-mode: normal !important;
  pointer-events: auto;
  background: #000;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  width: 3rem;
  height: 3rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}
#flip-btn:hover,
#flip-btn:focus-visible {
  opacity: 1;
}
#flip-btn .flip-icon {
  font-size: 1.6rem;
  line-height: 1;
  color: #fff;
  display: inline-block;
  transition: transform 0.4s ease;
}
#flip-btn.is-active .flip-icon {
  transform: scaleX(-1);
}

@media (max-height: 780px) {
  #flip-btn {
    bottom: calc(20svh - 3.5rem);
  }
}

@media (max-width: 1024px) {
  #flip-btn {
    bottom: 2rem;
    right: 1.2rem;
  }
}

/* ////////////////////////////////////////////////////////////
  SPスクロール中フェード
//////////////////////////////////////////////////////////// */

.fade-on-scroll {
  transition: opacity .8s ease;
}

@media (max-width: 767px) {
  body.is-sp-scrolling .fade-on-scroll {
    opacity: 0;
    pointer-events: none;
  }
  body.is-sp-scrolling .doc-native-wrapper {
    opacity: 1 !important;
    pointer-events: auto !important;
  }
}

/* ////////////////////////////////////////////////////////////
  SPレイアウト（767px以下）
//////////////////////////////////////////////////////////// */

@media screen and (max-width: 767px) {
  html, body {
    overflow-x: hidden !important;
  }
  .site-header {
    display: none;
  }
  ::selection {
    color: inherit;
  }

  .hero {
    opacity: 0.6;
    height: 100svh;
    overflow: visible;
    position: relative;
  }

  .hero .branding {
    top: 3svh;
    left: 4svw;
  }

  .site-title__main {
    font-size: clamp(1.6rem, 8vw, 2.4rem);
  }
  .site-title__sub {
    font-size: clamp(0.75rem, 3vw, 1rem);
  }

  .hero .scroll {
    display: none;
  }
}

/* ////////////////////////////////////////////////////////////
  タブレットレイアウト（768px〜1366px）
//////////////////////////////////////////////////////////// */

@media screen and (min-width: 768px) and (max-width: 1366px) {
  .site-header {
    display: none;
  }
  .hero .branding {
    top: 2svh;
  }
}

/* ////////////////////////////////////////////////////////////
  スマホ＋タブレット共通（1024px以下）
//////////////////////////////////////////////////////////// */

@media (max-width: 1024px) {
  .doc-native-wrapper {
    overflow: auto !important;
    -webkit-overflow-scrolling: touch;
    pointer-events: auto !important;
  }
  #native-doc {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateZ(0) scale(1);
    inset: 0;
  }
  #native-doc.is-flipped {
    transform: translateZ(0) scale(1) scaleX(-1);
  }
  #contents {
    padding: 0;
    -webkit-font-smoothing: antialiased;
  }
  #contents p span {
    overflow: auto !important;
    width: auto !important;
    height: auto !important;
  }
  #contents p img {
    width: 100% !important;
    height: auto !important;
  }
  #contents .doc-content {
    padding: 1.8rem !important;
    max-width: 100%;
  }
  #contents .doc-content p,
  #contents .doc-content li {
    line-height: 1.7;
  }
  table {
    width: 100%;
  }
  #lm-contrast-panel {
    display: none;
  }
}
