/**
 * ベースリセットと要素デフォルト
 *
 * Sibloo は Bootstrap 4.1.3 を強制的に読み込み、その Reboot がリセットの多くを
 * 担う。ここでは Reboot と同じ値を自前でも宣言し、Bootstrap の有無に関わらず
 * 同じ結果になるようにする。
 */

:root {
  /* アンカーで飛んだときに上へ空ける量。固定ヘッダーを置く案件では
   * その高さに合わせる。ベースの .header は position: relative で高さを
   * 持たないため、ここでは余白としての既定値だけを持つ。 */
  --scroll-offset: 3.75rem;

  /* テキスト選択時の色 */
  --selection-bg: var(--ink);
  --selection-fg: var(--snow);

  /* hr の罫線 */
  --hr-color: var(--light-gray);
}

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

*,
*::before,
*::after {
  /* Reboot 依存のうち最も影響が大きい。padding / sizes ユーティリティは
   * すべて border-box を前提にしている。 */
  box-sizing: border-box;
  min-width: 0px;
  min-height: 0px;
}

html {
  /* iOS の横向きで文字が自動拡大されるのを止める */
  -webkit-text-size-adjust: 100%;
  /* タップ時のハイライトを消す */
  -webkit-tap-highlight-color: transparent;

  /* 最小値13pxを保証し、1200px未満では最大22pxまでフォントサイズが流動する */
  font-size: clamp(13px, var(--font-size-base), 22px);

  @media screen and (min-width: 1200px) {
    font-size: clamp(0.1rem, var(--font-size-base), 24px);
  }
}

/**
 * ページ内リンクのスムーススクロール。
 *
 * ネイティブのハッシュ遷移に任せる。位置のオフセットは [id] の
 * scroll-margin-top が受け持つ。
 *
 * 「動きを減らす」設定の環境では即座にジャンプする。
 *
 * フォームのあるページでは 01_FormScript.js がこれを切る。validationEngine が
 * エラー箇所へ移動するときに使う jQuery の animate({ scrollTop }) と噛み合わない
 * ため。理由はそちらのコメントにある。
 */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  line-height: 1.5;
  /* 長い URL や英単語がはみ出して横スクロールを作るのを防ぐ。
   * 収まらないときだけ働くため、通常の行分割には影響しない。 */
  overflow-wrap: break-word;
  font-family: var(--font-sans);
  color: var(--ink);
  background-color: var(--light-gray);
}

#root {
  margin: 0 auto;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
}
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: inherit;
  line-height: inherit;
}

/**
 * リスト・図・引用の margin リセット。
 *
 * 余白はユーティリティで与える方針に揃える。padding-left と list-style は
 * 既定のまま残すため、箇条書きの体裁自体は変わらない。
 */
ul,
ol,
dl,
dd,
figure,
blockquote {
  margin: 0;
}

/* Bootstrap の hr は margin 1rem と rgba(0,0,0,.1) の罫線を持つ。
 * 余白はユーティリティで与える方針に揃え、色は変数にする。 */
hr {
  margin: 0;
  border: 0;
  border-top: 1px solid var(--hr-color);
}

img,
iframe,
video {
  max-width: 100%;
}

/* inline 由来の下端の隙間を防ぐ */
img,
svg {
  vertical-align: middle;
}

table {
  border-collapse: collapse;
}

iframe {
  border: none;
  box-shadow: none;
}

a,
a:hover {
  color: var(--ink);
}
/* Reboot と同値。ホバー時の下線を残すかは別途判断する */
a {
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

[id] {
  scroll-margin-top: var(--scroll-offset);
}

/* ユーティリティより後に読む必要があるためここに置いている。
 * 04_padding などへ先を越されると .p-16 のような指定に負けて、
 * 視覚的に隠しきれなくなる。 */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* フォーム要素はフォント関連を継承しない */
button,
input,
optgroup,
select,
textarea {
  margin: 0;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}
textarea {
  resize: vertical;
}

button {
  position: relative;
  appearance: none;
  cursor: pointer;
  box-shadow: none;
  border: 0;
  background: none;
  padding: 0;
}

/**
 * フォーカスリングはキーボード操作でだけ出す。
 *
 * Bootstrap 4.1.3 は button:focus に独自のリングを当てており、詳細度が
 * (0,1,1) あるため素の button { outline: none } では打ち消せない。
 * :not(:focus-visible) を重ねて (0,2,1) にし、ポインタ操作のときだけ消す。
 *
 * Bootstrap が外れた場合も :focus-visible 側が効くため、インジケータは
 * 失われない。
 */
button:focus:not(:focus-visible) {
  outline: none;
}
button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* CMS が箇条書きを <p> で出力するため、それを list-item として見せるための
 * アダプタ。ブログ固有ではないのでここに置いている。 */
.list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding-left: 1.5rem;
  list-style: disc outside none;

  & > p {
    margin: 0;
    display: list-item;
  }
}

/**
 * 印刷
 *
 * Bootstrap 4.1.3 は @page { size: a3 } と、body および .container への
 * min-width: 992px !important を当てており、そのままだと A3 用紙・デスクトップ幅で
 * 印刷される。これらは対になっていて、一部だけ戻すと用紙からはみ出す。
 *
 * ここでは全部戻し、画面と同じレスポンシブな見た目で印刷されるようにする。
 * デスクトップ幅で刷りたい案件は、これらを案件側で戻す。
 *
 * .container は自前では定義していない Bootstrap のクラスだが、案件が使っている
 * 場合に同じ問題が起きるため打ち消しておく。
 */
@media print {
  @page {
    size: auto;
  }

  body,
  .container {
    min-width: 0 !important;
  }
}

.button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1rem 1.5rem 1rem 2rem;
  border-radius: 9999px;
  max-width: 18.75rem;
  width: 100%;
  background-color: var(--ink);
  color: var(--snow);
  line-height: 1.25;
  font-weight: 500;
  transition: all 200ms ease;
  & > p {
    flex: 1 1 0%;
  }
  &::after {
    content: "";
    aspect-ratio: 1 / 1;
    width: 1.25rem;
    background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20d%3D%22M17.3172%2010.4422L11.6922%2016.0672C11.5749%2016.1845%2011.4159%2016.2503%2011.25%2016.2503C11.0841%2016.2503%2010.9251%2016.1845%2010.8078%2016.0672C10.6905%2015.9499%2010.6247%2015.7909%2010.6247%2015.625C10.6247%2015.4591%2010.6905%2015.3001%2010.8078%2015.1828L15.3664%2010.625H3.125C2.95924%2010.625%202.80027%2010.5592%202.68306%2010.4419C2.56585%2010.3247%202.5%2010.1658%202.5%2010C2.5%209.83424%202.56585%209.67527%202.68306%209.55806C2.80027%209.44085%202.95924%209.375%203.125%209.375H15.3664L10.8078%204.81719C10.6905%204.69991%2010.6247%204.54085%2010.6247%204.375C10.6247%204.20915%2010.6905%204.05009%2010.8078%203.93281C10.9251%203.81554%2011.0841%203.74965%2011.25%203.74965C11.4159%203.74965%2011.5749%203.81554%2011.6922%203.93281L17.3172%209.55781C17.3753%209.61586%2017.4214%209.68479%2017.4529%209.76066C17.4843%209.83654%2017.5005%209.91787%2017.5005%2010C17.5005%2010.0821%2017.4843%2010.1635%2017.4529%2010.2393C17.4214%2010.3152%2017.3753%2010.3841%2017.3172%2010.4422Z%22%20fill%3D%22white%22%2F%3E%0A%3C%2Fsvg%3E%0A");
    background-repeat: no-repeat;
    background-size: 100% 100%;
  }
  &:hover {
    text-decoration: none;
    color: var(--snow);
    opacity: 0.85;
    transform: scale(0.95);
  }
  &.button--center {
    justify-content: center;
    & > p {
      flex: 0 1 auto;
    }
  }
}


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

.line-animation {
  position: relative;
  width: 100%;
  aspect-ratio: 2107 / 270;
  overflow: hidden;
  --mask-image: url("/system_panel/uploads/images/animation-line.svg");
  &.line-animation--2 {
    aspect-ratio: 1918 / 272;
    --mask-image: url("/system_panel/uploads/images/animation-line-2.svg");
  }
  &.line-animation--3 {
    aspect-ratio: 782 / 645;
    --mask-image: url("/system_panel/uploads/images/animation-line-3.svg");
    position: absolute;
    top: -2.5rem;
    right: -3.75rem;
    width: 48.875rem;
  }
  &.line-animation--4 {
    aspect-ratio: 1 / 1;
    --mask-image: url("/system_panel/uploads/images/animation-line-4.svg");
  }
}

.line-animation::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: var(--yellow);
  -webkit-mask-image: var(--mask-image);
  mask-image: var(--mask-image);
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  
  clip-path: inset(0 0 0 100%);
  transition: clip-path 2s cubic-bezier(0.25, 1, 0.5, 1) 0.4s;
  will-change: clip-path;
}

.line-animation.is-visible::before {
  clip-path: inset(0 0 0 0);
}

.line-animation img {
  width: 100%;
  height: auto;
  display: block;
}

.page-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  
  &.page-hero--visible {
    overflow: visible;
  }

  & .page-hero__typo {
    position: relative;
    z-index: 1;
    display: inline-block;
    font-family: var(--font-display2);
    font-weight: 400;
    font-size: 3.75rem;
    line-height: 0.75;
    --tracking: 0;
    text-align: end;
    color: rgba(50, 50, 50, 0.01);
    -webkit-text-fill-color: rgba(50, 50, 50, 0.01);
    background: none;
    -webkit-background-clip: border-box;
    background-clip: border-box;
    -webkit-mask: none;
    mask: none;
    text-shadow: none;
    mix-blend-mode: normal;
    filter: var(--page-hero-inner-filter, none);
    @media (min-width: 768px) {
      font-size: 8rem;
    }
    @media (min-width: 1024px) {
      font-size: 10rem;
    }
    @media (min-width: 1200px) {
      font-size: 15rem;
    }
    &.page-hero__typo--sans {
      font-family: var(--font-sans);
      font-weight: 900;
    }
  }

  & .line-animation {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 131.75rem;
  }
}

.company-line {
  position: absolute;
  top: calc(50% + 12.5rem);
  left: 50%;
  transform: translate(-50%, -50%);
  width: 119.875rem;
}

.form-line {
  position: absolute;
  top: calc(50% + 4.5rem);
  left: 50%;
  transform: translate(-50%, -50%);
  width: 131.625rem;
}

.section-title {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  & > p {
    line-height: 1;
    --tracking: 0;
    font-family: var(--font-display1);
    font-size: 2rem;
  }
  & h2, & h3, & h4, & h5, & h6 {
    line-height: 1.5;
    --tracking: 0.16em;
    font-family: var(--font-serif);
    font-size: 1.25rem;
  }
  @media (min-width: 768px) {
     & > p {
      font-size: 3rem;
    }
    & h2, & h3, & h4, & h5, & h6 {
      font-size: 1.5rem;
    } 
  }
  @media (min-width: 1024px) {
     & > p {
      font-size: 3.5rem;
    }
    & h2, & h3, & h4, & h5, & h6 {
      font-size: 1.75rem;
    } 
  }
  @media (min-width: 1200px) {
     & > p {
      font-size: 4rem;
    }
    & h2, & h3, & h4, & h5, & h6 {
      font-size: 2rem;
    } 
  }
}

.cube-grid[data-miyabi-tiles] {
  display: block;
  container-type: normal;
  overflow: visible;
  height: var(--miyabi-grid-height, 24rem);
  background: transparent;
  pointer-events: none;
  isolation: isolate;
}

.cube-grid[data-miyabi-tiles] > .miyabi-tiles__canvas {
  position: absolute;
  display: block;
  max-width: none;
  max-height: none;
  pointer-events: none;
}

/* 6列の構成を保ち、スマートフォンでは1枚を約55〜80pxに収める。 */
@media (max-width: 767px) {
  .cube-grid[data-miyabi-tiles] {
    max-width: var(--miyabi-mobile-width, min(128vw, 600px));
  }
}

.cube-grid-wrapper {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  
  @media (min-width: 1024px) {
    width: 80%;
    padding-top: 0;
  }
}

.kaiten-text {
  width: 80%;
  max-width: 34.375rem;
  animation: infinite-rotate 20s linear infinite;
}

@keyframes infinite-rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}


.swiper {
  &:not(.swiper-initialized) {
    & .swiper-wrapper {
      display: flex;
      overflow: auto;
    }
    & .swiper-slide {
      min-width: 100%;
      width: 100%;
    }
  }
}






