/**
 * ベースリセットと要素デフォルト
 *
 * 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(--snow);
  font-weight: 700;
  position: relative;
  z-index: 0;
  &::before {
    content: "";
    background-image: var(--bg-circuit);
    position: absolute;
    inset: 0;
    filter: blur(2px);
    z-index: -1;
    pointer-events: none;
  }
}

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

.footer-bg-image {
  position: absolute;
  inset: 0;
  &::before,
  &::after {
    content: "";
    pointer-events: none;
    position: absolute;
    inset: 0;
  }
  &::before {
    background-image: var(--bg-circuit);
  }
  &::after {
    background: linear-gradient(0deg, rgba(173, 165, 15, 0.10) 0%, rgba(173, 165, 15, 0.10) 100%), linear-gradient(180deg, rgba(22, 29, 41, 0.30) 0%, rgba(22, 29, 41, 0.80) 65%, #161D29 100%);
    backdrop-filter: blur(2px);
  }
  & img {
    object-fit: cover;
    width: 100%;
    height: 100%;
  }
}

.section-title {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  & > p {
    color: var(--blue);
    line-height: 1;
    --tracking: -0.02em;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.5rem;
  }
  & h2, & h3, & h4, & h5, & h6 {
    line-height: 1.25;
    --tracking: -0.04em;
    font-weight: 900;
    font-size: 2.5rem;
  }
  @media (min-width: 768px) {
    & > p {
      font-size: 1.75rem;
    }
    & h2, & h3, & h4, & h5, & h6 {
      font-size: 3rem;
    }
  }
  @media (min-width: 1024px) {
    & > p {
      font-size: 2rem;
    }
    & h2, & h3, & h4, & h5, & h6 {
      font-size: 3.5rem;
    }
  }
  @media (min-width: 1200px) {
    & > p {
      font-size: 2.5rem;
    }
    & h2, & h3, & h4, & h5, & h6 {
      font-size: 5rem;
    }
  }
  
  &.section-title--snow {
    color: var(--snow);
    & > p {
      color: var(--light-mustard);
    }
  }
  &.section-title--snow-blue {
    & > p {
      color: var(--blue);
    }
  }
  
  &.section-title--32 {
    & > p {
      font-size: 1.25rem;
    }
    & h2, & h3, & h4, & h5, & h6 {
      font-size: 1.25rem;
    }
    @media (min-width: 768px) {
      & > p {
        font-size: 1.5rem;
      }
      & h2, & h3, & h4, & h5, & h6 {
        font-size: 1.5rem;
      }
    }
    @media (min-width: 1024px) {
      & > p {
        font-size: 1.75rem;
      }
      & h2, & h3, & h4, & h5, & h6 {
        font-size: 1.75rem;
      }
    }
    @media (min-width: 1200px) {
      & > p {
        font-size: 2rem;
      }
      & h2, & h3, & h4, & h5, & h6 {
        font-size: 2rem;
      }
    }
  }
  &.section-title--64 {
    & > p {
      font-size: 1.25rem;
    }
    & h2, & h3, & h4, & h5, & h6 {
      font-size: 2rem;
    }
    @media (min-width: 768px) {
      & > p {
        font-size: 1.5rem;
      }
      & h2, & h3, & h4, & h5, & h6 {
        font-size: 2.5rem;
      }
    }
    @media (min-width: 1024px) {
      & > p {
        font-size: 1.75rem;
      }
      & h2, & h3, & h4, & h5, & h6 {
        font-size: 3rem;
      }
    }
    @media (min-width: 1200px) {
      & > p {
        font-size: 2rem;
      }
      & h2, & h3, & h4, & h5, & h6 {
        font-size: 4rem;
      }
    }
  }
}

.button {
  pointer-events: all;
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-inline: 1.25rem 1rem;
  line-height: 1.25;
  color: var(--snow);
  background-color: var(--button-color);
  box-shadow: 0 2px 6px 1px rgba(0, 0, 0, 0.08), 0 4px 12px 2px rgba(0, 0, 0, 0.08), 0 8px 24px 4px rgba(0, 0, 0, 0.08);
  --button-color: var(--blue);
  transition: all 200ms ease;
  &:hover {
    text-decoration: none;
    color: var(--snow);
    opacity: 0.85;
    transform: scale(0.95);
  }
  &::before {
    content: "";
    width: 1px;
    height: 3.25rem;
    background-color: var(--snow);
    margin-left: 2rem;
    order: 1;
  }
  &::after {
    content: "";
    width: 1.25rem;
    aspect-ratio: 1 / 1;
    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%22M13.3935%209.47394C13.7523%209.73288%2013.7523%2010.2671%2013.3935%2010.5261L7.36581%2014.8762C6.93675%2015.1858%206.3374%2014.8792%206.3374%2014.3501V5.6499C6.3374%205.12078%206.93675%204.81419%207.36581%205.12384L13.3935%209.47394Z%22%20fill%3D%22white%22%2F%3E%0A%3C%2Fsvg%3E%0A");
    background-size: 100% 100%;
    background-repeat: no-repeat;
    order: 2;
  }
  
  &.button--mustard {
    --button-color: var(--mustard);
  }
  &.button--color-reverse {
    color: var(--button-color);
    background-color: var(--snow);
    &:hover {
      color: var(--button-color);
    }
    &::before {
      background-color: var(--button-color);
    }
    &::after {
      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%22M13.3935%209.47394C13.7523%209.73288%2013.7523%2010.2671%2013.3935%2010.5261L7.36581%2014.8762C6.93675%2015.1858%206.3374%2014.8792%206.3374%2014.3501V5.6499C6.3374%205.12078%206.93675%204.81419%207.36581%205.12384L13.3935%209.47394Z%22%20fill%3D%22%230F45AD%22%2F%3E%0A%3C%2Fsvg%3E%0A");
    }
    &.button--mustard {
      &::after {
        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%22M13.3935%209.47394C13.7523%209.73288%2013.7523%2010.2671%2013.3935%2010.5261L7.36581%2014.8762C6.93675%2015.1858%206.3374%2014.8792%206.3374%2014.3501V5.6499C6.3374%205.12078%206.93675%204.81419%207.36581%205.12384L13.3935%209.47394Z%22%20fill%3D%22%23ADA50F%22%2F%3E%0A%3C%2Fsvg%3E%0A");
      }
    }
  }
  
  &.button--contact {
    gap: 0.75rem;
    padding-inline: 1.25rem 0.75rem;
    font-size: 1.25rem;
    &::before {
      height: 4rem;
    }
    &::after {
      width: 2.5rem;
      background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20d%3D%22M33.3333%2014.7804L20.9245%2023.0535C20.3647%2023.4267%2019.6354%2023.4267%2019.0755%2023.0535L6.66668%2014.7804V28.3334C6.66668%2028.7754%206.8424%2029.1992%207.15496%2029.5118C7.46752%2029.8244%207.89132%2030.0001%208.33334%2030.0001H31.6667C32.1087%2030.0001%2032.5325%2029.8244%2032.8451%2029.5118C33.1576%2029.1992%2033.3333%2028.7754%2033.3333%2028.3334V14.7804ZM8.33334%2010.0001C7.89132%2010.0001%207.46752%2010.1758%207.15496%2010.4884C7.03285%2010.6105%206.93185%2010.7496%206.85385%2010.9001L20%2019.6632L33.1445%2010.9001C33.0666%2010.7499%2032.967%2010.6103%2032.8451%2010.4884C32.5325%2010.1758%2032.1087%2010.0001%2031.6667%2010.0001H8.33334ZM36.6667%2028.3334C36.6667%2029.6595%2036.1395%2030.9309%2035.2018%2031.8686C34.2642%2032.8063%2032.9928%2033.3334%2031.6667%2033.3334H8.33334C7.00726%2033.3334%205.73587%2032.8063%204.79819%2031.8686C3.86051%2030.9309%203.33334%2029.6595%203.33334%2028.3334V11.6667C3.33334%2010.3407%203.86051%209.06927%204.79819%208.13159C5.73587%207.19391%207.00726%206.66675%208.33334%206.66675H31.6667C32.9928%206.66675%2034.2641%207.19391%2035.2018%208.13159C36.1395%209.06927%2036.6667%2010.3407%2036.6667%2011.6667V28.3334Z%22%20fill%3D%22%230F45AD%22%2F%3E%0A%3C%2Fsvg%3E%0A");
    }
    @media (min-width: 768px) {
      gap: 1rem;
      padding-inline: 2rem 1rem;
      font-size: 2rem;
      &::before {
        height: 5rem;
      }
      &::after {
        width: 3rem;
      }
    }
  }
}

.page-hero {
  position: relative;
  display: grid;
  gap: 3rem;
  padding: 1.25rem;
  border-bottom: 1px solid hsl(from var(--blue) h s l / 0.3);
  @media (min-width: 768px) {
    padding-left: 2.5rem;
    grid-template-columns: 4fr 5fr;
  }
  @media (min-width: 1024px) {
    padding-left: 5rem;
    grid-template-columns: 2fr 3fr;
  }
  @media (min-width: 1200px) {
    padding-left: 7.5rem;
    grid-template-columns: 600fr 812fr;
  }
  &.page-hero--engineering {
    @media (min-width: 1024px) {
      grid-template-columns: 4fr 5fr;
    }
    @media (min-width: 1200px) {
      grid-template-columns: 640fr 772fr;
    }
  }
  
  & .page-hero__image {
    position: relative;
    aspect-ratio: 4 / 3;
    &::before,
    &::after {
      content: "";
      position: absolute;
      height: 2.5rem;
      opacity: 0.6;
    }
    &::before {
      width: 7.5rem;
      right: 12.5rem;
      bottom: 2.5rem;
      background-color: var(--light-blue);
    }
    &::after {
      width: 15rem;
      right: 0;
      bottom: 0;
      background-color: var(--blue);
    }
    & img {
      object-fit: cover;
      width: 100%;
      height: 100%;
    }
    @media (min-width: 768px) {
      aspect-ratio: unset;
    }
    @media (min-width: 1024px) {
      &::before,
      &::after {
        opacity: 1;
      }
    }
    @media (min-width: 1200px) {
      aspect-ratio: 4 / 3;
    }
  }
  
  & .page-hero__title {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    & > p {
      color: var(--blue);
      line-height: 1;
      --tracking: -0.02em;
      font-family: var(--font-display);
      font-weight: 800;
      font-size: 1.5rem;
    }
    & h1 {
      line-height: 1.25;
      --tracking: -0.04em;
      font-weight: 900;
      font-size: 2.5rem;
    }
    @media (min-width: 768px) {
      & > p {
        font-size: 1.75rem;
      }
    }
    @media (min-width: 1024px) {
      & > p {
        font-size: 2rem;
      }
      & h1 {
        font-size: 3rem;
      }
    }
    @media (min-width: 1200px) {
      & > p {
        font-size: 2.5rem;
      }
      & h1 {
        font-size: 5rem;
      }
    }
  }
}

.image-dec {
  position: relative;
  &::before,
  &::after {
    content: "";
    position: absolute;
    height: 2.5rem;
    opacity: 0.6;
  }
  &::before {
    width: 7.5rem;
    right: 12.5rem;
    bottom: 2.5rem;
    background-color: var(--light-blue);
  }
  &::after {
    width: 15rem;
    right: 0;
    bottom: 0;
    background-color: var(--blue);
  }
  
  &.image-dec--mustard {
    &::before {
      background-color: var(--light-mustard);
    }
    &::after {
      background-color: var(--mustard);
    }
  }
}
.language-switcher__link {
  padding: 0.5rem 1rem;
  &:hover {
    text-decoration: none;
  }
}











