/**
 * ベースリセットと要素デフォルト
 *
 * 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);
  font-weight: 700;
  color: var(--ink);
  background-color: var(--snow);
}

#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;
  }
}

.backdrop-accent--to-l {
  background: linear-gradient(
    270deg,
    hsla(from var(--accent) h s l / 0%) 0%,
    hsla(from var(--accent) h s l / 15%) 100%
  );
}
.backdrop-accent--to-r {
  background: linear-gradient(
    270deg,
    hsla(from var(--accent) h s l / 15%) 0%,
    hsla(from var(--accent) h s l / 0%) 100%
  );
}
.backdrop-accent {
  background-color: hsla(from var(--accent) h s l / 35%);
}

.button {
  border-radius: 9999px;
  border: none;
  background-color: var(--accent);
  color: var(--accent-fg);
  font-weight: 700;
  line-height: 1.25;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-family: var(--font-display-1);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  &::after {
    content: "";
    background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cmask%20id%3D%22mask0_83_824%22%20style%3D%22mask-type%3Aalpha%22%20maskUnits%3D%22userSpaceOnUse%22%20x%3D%220%22%20y%3D%220%22%20width%3D%2216%22%20height%3D%2216%22%3E%0A%3Crect%20width%3D%2216%22%20height%3D%2216%22%20fill%3D%22%23111111%22%2F%3E%0A%3C%2Fmask%3E%0A%3Cg%20mask%3D%22url(%23mask0_83_824)%22%3E%0A%3Cpath%20d%3D%22M4.36062%2012.3104L3.11646%2011.0662L9.29979%204.88288H3.87729V3.11621H12.3106V11.5495H10.544V6.12704L4.36062%2012.3104Z%22%20fill%3D%22%23111111%22%2F%3E%0A%3C%2Fg%3E%0A%3C%2Fsvg%3E%0A");
    width: 1rem;
    height: 1rem;
    background-repeat: no-repeat;
    background-size: contain;
  }
  & .icon {
    width: 1rem;
    height: 1rem;
  }
  
  &:hover {
    transform: scale(0.99);
    text-decoration: none;
    color: var(--accent-fg);
  }
  
  @media (min-width: 768px) {
    font-size: 1.125rem;
    padding: 1.5rem 3rem;
    &::after {
      width: 1.5rem;
      height: 1.5rem;
    }
    & .icon {
      width: 1.5rem;
      height: 1.5rem;
    }
  }
  
  &.button--snow {
    background-color: var(--snow);
    color: var(--ink);
  }
  &.button--ink {
    background-color: var(--ink);
    color: var(--snow);
  }
  &.button--no-arrow::after {
    content: none;
  }
  &.button--snow-arrow::after {
    background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cmask%20id%3D%22mask0_142_2810%22%20style%3D%22mask-type%3Aalpha%22%20maskUnits%3D%22userSpaceOnUse%22%20x%3D%220%22%20y%3D%220%22%20width%3D%2224%22%20height%3D%2224%22%3E%0A%3Crect%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22%23111111%22%2F%3E%0A%3C%2Fmask%3E%0A%3Cg%20mask%3D%22url(%23mask0_142_2810)%22%3E%0A%3Cpath%20d%3D%22M6.54105%2018.4661L4.6748%2016.5998L13.9498%207.3248H5.81605V4.6748H18.4661V17.3248H15.8161V9.19106L6.54105%2018.4661Z%22%20fill%3D%22white%22%2F%3E%0A%3C%2Fg%3E%0A%3C%2Fsvg%3E%0A");
  }
}

.halftone-backdrop {
  overflow: hidden;
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  &::before, &::after {
    position: absolute;
    content: "";
    width: 100%;
    max-width: 43.75rem;
    aspect-ratio: 1 / 1;
    background-color: var(--accent);
    -webkit-mask: url(/system_panel/uploads/images/halftone-circle.svg) center / contain no-repeat;
    mask: url(/system_panel/uploads/images/halftone-circle.svg) center / contain no-repeat;
    display: none;
    @media (min-width: 768px) {
      display: block;
    }
  }
  &.halftone-backdrop--tlbr {
    &::before {
      top: 0;
      left: 0;
      transform: translate(-35%, -60%);
    }
    &::after {
      bottom: 0;
      right: 0;
      transform: translate(35%, 60%);
    }
  }
  &.halftone-backdrop--trbl {
    &::before {
      top: 0;
      right: 0;
      transform: translate(35%, -60%);
    }
    &::after {
      bottom: 0;
      left: 0;
      transform: translate(-35%, 60%);
    }
  }
  &.halftone-backdrop--ink {
    &::before, &::after {
      background-color: var(--ink);
    }
  }
}

.footer-logo {
  & img {
    filter: drop-shadow(0 16px 48px rgba(255, 255, 255, 0.48)) drop-shadow(0 8px 24px rgba(255, 255, 255, 0.32)) drop-shadow(0 4px 12px #FFF) drop-shadow(0 2px 6px rgba(255, 255, 255, 0.08));
    height: 3.75rem;
    margin-inline: auto;
    display: block;
    @media (min-width: 768px) {
      height: 12.5rem;
    }
  }
  &:nth-child(2) {
    transform: translateY(-150%);
  }
}

.page-hero {
  position: relative;
  padding-block: 15rem 5rem;
  &::after {
    pointer-events: none;
    content: "";
    position: absolute;
    inset: 0;
    background-image: linear-gradient(hsl(from var(--ink) h s l / 40%), hsl(from var(--ink) h s l / 40%)), linear-gradient(hsl(from var(--accent) h s l / 40%), hsl(from var(--accent) h s l / 40%));
  }
  & .page-hero__title {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
    max-width: 80rem;
    & > p {
      line-height: 1;
      --tracking: -0.04em;
      color: var(--accent);
      font-family: var(--font-display-2);
      font-weight: 400;
      font-size: 4rem;
    }
    & > h1 {
      line-height: 1.25;
      color: var(--snow);
      font-weight: 900;
      font-size: 1.5rem;
    }
    @media (min-width: 768px) {
      & > p {
        font-size: 4.5rem;
      }
      & > h1 {
        font-size: 1.75rem;
      }
    }
    @media (min-width: 1024px) {
      & > p {
        font-size: 5rem;
      }
      & > h1 {
        font-size: 2rem;
      }
    }
  }
}

.section-title {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  & > p {
    line-height: 1;
    --tracking: -0.04em;
    color: var(--accent);
    font-family: var(--font-display-2);
    font-weight: 400;
    font-size: 4rem;
  }
  & > h2, & > h3, & > h4, & > h5, & > h6 {
    line-height: 1.25;
    font-weight: 900;
    font-size: 1.5rem;
  }
  @media (min-width: 768px) {
    & > p {
      font-size: 4.5rem;
    }
    & > h2, & > h3, & > h4, & > h5, & > h6 {
      font-size: 1.75rem;
    }
  }
  @media (min-width: 1024px) {
    & > p {
      font-size: 5rem;
    }
    & > h2, & > h3, & > h4, & > h5, & > h6 {
      font-size: 2rem;
    }
  }
}

.flow-list {
  display: grid;
  gap: 1.5rem;
  
  @media screen and (min-width: 768px) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  @media screen and (min-width: 1200px) {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
  }

  & .flow-list__item {
    display: flex;
    flex-direction: column;
    gap: 1rem;

    & .flow-list__title {
      border-radius: 0;
      padding: 1.5rem;
      text-align: center;
      font-size: 1.125rem;
      line-height: 1.25;
    }
    & .flow-list__container {
      border-radius: 0;
      padding: 1rem;
      background-color: hsl(from var(--accent) h s calc(l * 1.8));
    }

    /* --- 色の段階変化（乗算による調整） --- */
    &:first-child .flow-list__title {
      background-color: hsl(from var(--accent) h s calc(l * 1.6));
      color: var(--ink);
    }
    &:nth-child(2) .flow-list__title {
      background-color: hsl(from var(--accent) h s calc(l * 1.31));
      color: var(--ink);
    }
    &:nth-child(3) .flow-list__title {
      background-color: hsl(from var(--accent) h s calc(l * 1.25));
      color: var(--ink);
    }
    &:nth-child(4) .flow-list__title {
      background-color: hsl(from var(--accent) h s calc(l * 1.1));
      color: var(--ink);
    }
    &:last-child .flow-list__title {
      background-color: var(--accent);
      color: var(--ink);
    }
    
    @media screen and (min-width: 768px) {
      & .flow-list__title {
        border-radius: 0;
        padding: 1.5rem;
      }
      & .flow-list__container {
        border-radius: 0;
        padding: 2rem;
        flex: 1 0 0%;
      }
      & .flow-list__content {
        flex: 1 0 0%;
      }
    }
    @media screen and (min-width: 1200px) {
      gap: 2rem;
      
      /* --- 1200px以上：レイヤー構造と z-index による矢印の重ね合わせ --- */
      /* 重なり順を 左(1番目) > 右(5番目) に制御 */
      &:nth-child(1) { z-index: 5; }
      &:nth-child(2) { z-index: 4; }
      &:nth-child(3) { z-index: 3; }
      &:nth-child(4) { z-index: 2; }
      &:nth-child(5) { z-index: 1; }

      & .flow-list__title {
        position: relative;
        border-radius: 0;
        
        /* 1〜4番目で共通して右側に飛び出す矢印要素 */
        &::before {
          content: "";
          position: absolute;
          top: 0;
          right: -20px;
          width: 20px;
          height: 100%;
          z-index: 1;
          clip-path: polygon(0 0, 100% 50%, 0 100%);
        }
      }

      /* 1〜4番目の各矢印の背景色定義 */
      &:first-child {
        & .flow-list__title::before {
          background-color: hsl(from var(--accent) h s calc(l * 1.6));
        }
        & .flow-list__container {
          border-top-right-radius: 0;
          border-bottom-right-radius: 0;
        }
        & .flow-list__content {
          border-right: 1px dashed var(--accent);
          padding-right: 2rem;
          margin-right: -2rem;
          height: 100%;
        }
      }

      &:nth-child(2), &:nth-child(3), &:nth-child(4) {
        & .flow-list__container {
          border-radius: 0;
        }
        & .flow-list__content {
          border-right: 1px dashed var(--accent);
          padding-right: 2rem;
          margin-right: -2rem;
          height: 100%;
        }
      }

      &:nth-child(2) .flow-list__title::before {
        background-color: hsl(from var(--accent) h s calc(l * 1.31));
      }
      &:nth-child(3) .flow-list__title::before {
        background-color: hsl(from var(--accent) h s calc(l * 1.25));
      }
      &:nth-child(4) .flow-list__title::before {
        background-color: hsl(from var(--accent) h s calc(l * 1.1));
      }

      /* 5番目（最後）：右へ飛び出させず、内側に先端を収める */
      &:last-child {
        & .flow-list__title {
          clip-path: polygon(0% 0%, calc(100% - 20px) 0%, 100% 50%, calc(100% - 20px) 100%, 0% 100%);
          
          &::before {
            display: none;
          }
        }
        & .flow-list__container {
          border-top-left-radius: 0;
          border-bottom-left-radius: 0;
        }
        & .flow-list__content {
          padding-right: 2rem;
          margin-right: -2rem;
          height: 100%;
        }
      }
    }
  }
}

.service-selector {
  position: relative;
  padding: 0.5rem 0.75rem;
  border: 2px solid var(--selector-color);
  font-size: 0.875rem;
  color: var(--selector-color);
  opacity: 0.5;
  transition: opacity ease 200ms;
  &.selected {
    opacity: 1;
  }
  &.birtsky-selector {
    --selector-color: var(--violet);
  }
  &.mitsuya-selector {
    --selector-color: var(--dark-red);
  }
  &.builbri-selector {
    --selector-color: var(--yellow);
  }
}

.rookies-title {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  background-color: var(--accent);
  line-height: 1.25;
  --tracking: -0.02em;
  color: var(--snow);
  font-weight: 900;
  white-space: nowrap;
  & > h3 {
    font-size: 1.25rem;
    transform: skew(-11deg);
  }
  @media (min-width: 768px) {
    & > h3 {
      font-size: 1.5rem;
    }
  }
  @media (min-width: 1024px) {
    & > h3 {
      font-size: 2rem;
    }
  }
}

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

.gallery-slider {
  width: 100%;
  & .swiper-wrapper {
    transition-timing-function: linear;
  }
  & .swiepr-slide {
    & img {
      object-fit: cover;
      width: 100%;
      aspect-ratio: 3 / 2;
    }
  }
}

.service-hero {
  position: relative;
  padding-block: 20rem 5rem;
  &::after {
    pointer-events: none;
    content: "";
    position: absolute;
    inset: 0;
    background-image: linear-gradient(hsl(from var(--ink) h s l / 40%), hsl(from var(--ink) h s l / 40%)), linear-gradient(hsl(from var(--accent) h s l / 40%), hsl(from var(--accent) h s l / 40%));
  }
  & .service-hero__logo {
    position: absolute;
    top: -1.5rem;
    left: 0;
    transform: translateY(-100%);
    height: 11.25rem;
    @media (min-width: 768px) {
      left: -1.5rem;
      height: 12.5rem;
    }
    @media (min-width: 1200px) {
      height: 13.75rem;
    }
  }
}

.group-card {
  overflow: hidden;
  position: relative;
  padding: 5.5rem 1.25rem 5rem;
  color: var(--snow);
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  transition: opacity ease 200ms;
  &::after {
    pointer-events: none;
    content: "";
    position: absolute;
    inset: 0;
    background-color: var(--violet);
    opacity: 0.6;
  }
  &:hover {
    text-decoration: none;
    opacity: 0.85;
    color: var(--snow);
  }
  @media (min-width: 768px) {
    padding-inline: 2.5rem;
  }
  @media (min-width: 1200px) {
    padding-inline: 3.75rem;
  }
  
  & .group-card__bg-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  & .group-card__typo {
    position: absolute;
    z-index: 1;
    top: -0.3em;
    left: -0.125em;
    opacity: 0.3;
    line-height: 1.25;
    --tracking: -0.08em;
    font-family: var(--font-display-2);
    font-size: 7rem;
    @media (min-width: 768px) {
      font-size: 10rem;
    }
    @media (min-width: 1024px) {
      font-size: 8rem;
    }
    @media (min-width: 1200px) {
      font-size: 10rem;
    }
  }
  & .group-card__logo {
    position: relative;
    z-index: 1;
    height: 10rem;
    margin-inline: auto;
    @media (min-width: 768px) {
      height: 12.5rem;
    }
  }
  & .group-card__content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    & .group-card__title {
      display: flex;
      flex-direction: column;
      gap: 0.25rem;
      text-align: center;
      line-height: 1.25;
      font-weight: 900;
    }
    & .group-card__company-name {
      font-size: 1.5rem;
    }
    & .group-card__business {
      font-size: 1rem;
    }
    & .group-card__text {
      line-height: 1.8;
      font-size: 0.875rem;
    }
    @media (min-width: 768px) {
      & .group-card__company-name {
        font-size: 2rem;
      }
      & .group-card__business {
        font-size: 1.5rem;
      }
      & .group-card__text {
        font-size: 1rem;
      }
    }
    @media (min-width: 1024px) {
      & .group-card__company-name {
        font-size: 1.5rem;
      }
      & .group-card__business {
        font-size: 1rem;
      }
    }
    @media (min-width: 1200px) {
      & .group-card__company-name {
        font-size: 2rem;
      }
      & .group-card__business {
        font-size: 1.5rem;
      }
    }
  }
  
  &.group-card--mitsuya {
    &::after {
      background-color: var(--dark-red);
    }
    & .group-card__typo {
      text-align: end;
      inset: auto auto -0.3em -0.25em;
    }
  }
  &.group-card--builbri {
    &::after {
      background-color: var(--yellow);
    }
    & .group-card__typo {
      text-align: end;
      right: -0.25em;
      left: auto;
    }
  }
}

.service-contact-filter {
  &::after {
    pointer-events: none;
    content: "";
    position: absolute;
    inset: 0;
    background-color: var(--accent);
    opacity: 0.4;
    clip-path: polygon(0 0, 0% 100%, 100% 0);
  }
}


.slide-gallery {
  &.swiper {
    overflow: visible;
    &:not(.swiper-initialized) {
      & .swiper-wrapper {
        display: flex;
        overflow-x: auto;
      }
      & .swiper-slide {
        min-width: 25rem;
        width: 25rem;
      }
    }
  }
  & .swiper-wrapper {
    transition-timing-function: linear;
  }
}




