/*
 * 基本スタイル：リセット、タイポグラフィ、共通パーツ、ヘッダー、フッター。
 */

/* ---------------------------------------------------------- reset */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--sp-6));
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  letter-spacing: var(--ls-body);
  font-feature-settings: "palt" 1;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

img,
svg,
picture {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

a {
  color: var(--ink-blue);
  text-decoration-thickness: 1px;
  text-underline-offset: .25em;
  transition: color var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease);
}

a:hover {
  color: var(--navy);
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--ink-blue);
  outline-offset: 3px;
}

.is-invert :focus-visible,
.invert-surface :focus-visible {
  outline-color: var(--gold);
}

/* 角丸と影は使わない（design-tokens.md の禁止事項）。 */

/* ---------------------------------------------------------- layout */

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  position: relative;
  padding-block: var(--section-y);
}

.section--tight {
  padding-block: clamp(72px, 8vw, 128px);
}

.invert-surface {
  background: var(--navy-deep);
  color: var(--paper);
}

.invert-surface a {
  color: var(--paper);
}

.invert-surface a:hover {
  color: var(--gold);
}

.alt-surface {
  background: var(--paper-alt);
}

.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 999;
  padding: var(--sp-3) var(--sp-5);
  background: var(--navy);
  color: var(--paper);
}

.skip-link:focus {
  left: var(--sp-4);
  top: var(--sp-4);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------------------------------------------------------- type */

.num,
.numeral {
  font-family: var(--font-num);
  font-weight: 500;
  letter-spacing: var(--ls-num);
  line-height: var(--lh-tight);
  font-variant-numeric: lining-nums;
}

.mincho {
  font-family: var(--font-mincho);
  font-weight: 400;
  letter-spacing: var(--ls-heading);
  line-height: var(--lh-heading);
}

/*
 * 縦組み。1024px 以上でのみ発動する。
 * 文字を1文字ずつ分割してはいけない。要素ごと writing-mode を当てる。
 */
.v-text {
  writing-mode: horizontal-tb;
}

@media (min-width: 1024px) {
  .v-text {
    writing-mode: vertical-rl;
    font-feature-settings: "vert" 1, "vkrn" 1, "palt" 1;
    text-orientation: mixed;
  }

  .v-text .num {
    text-combine-upright: all;
  }
}

/* ---------------------------------------------------------- section head */

.section-head {
  position: relative;
  padding-left: clamp(40px, 4vw, 56px);
}

.section-head__rule {
  position: absolute;
  left: clamp(8px, 1vw, 14px);
  top: 4px;
  width: var(--line-rule);
  height: clamp(56px, 6vw, 78px);
  background: var(--gold);
  transform: rotate(var(--angle-rule));
}

/* 見出しの上に置く欧文の小ラベル。セクション見出し以外でも使う。 */
.eyebrow {
  display: block;
  font-family: var(--font-num);
  font-size: .75rem;
  letter-spacing: .34em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--gold-dark);
}

.invert-surface .eyebrow {
  color: var(--gold);
}

.section-head__en {
  display: block;
  font-family: var(--font-num);
  font-size: .75rem;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--gold-dark);
  line-height: 1;
}

.section-head.is-invert .section-head__en {
  color: var(--gold);
}

.section-head__ja {
  margin-top: var(--sp-5);
  font-family: var(--font-mincho);
  font-weight: 400;
  font-size: var(--fs-h2);
  line-height: var(--lh-heading);
  letter-spacing: var(--ls-heading);
  color: var(--navy);
}

.section-head.is-invert .section-head__ja {
  color: var(--paper);
}

.section-head__lead {
  margin-top: var(--sp-5);
  max-width: 46em;
  color: var(--ink-muted);
}

.section-head.is-invert .section-head__lead {
  color: rgba(255, 255, 255, .82);
}

/* ---------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-6);
  border: var(--line-hair) solid transparent;
  font-size: var(--fs-small);
  font-weight: 500;
  letter-spacing: .12em;
  line-height: 1;
  text-decoration: none;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}

.btn__icon {
  flex: none;
  transition: transform var(--dur-base) var(--ease);
}

.btn:hover .btn__icon {
  transform: translateX(4px);
}

.btn--primary {
  background: var(--navy);
  color: var(--paper);
}

.btn--primary:hover {
  background: var(--ink-blue);
  color: var(--paper);
}

.btn--gold {
  background: var(--gold);
  color: var(--navy-deep);
}

.btn--gold:hover {
  background: #F5CA74;
  color: var(--navy-deep);
}

.btn--ghost {
  border-color: var(--line);
  color: var(--ink);
}

.btn--ghost:hover {
  border-color: var(--navy);
  background: var(--navy);
  color: var(--paper);
}

.invert-surface .btn--ghost {
  border-color: var(--line-invert);
  color: var(--paper);
}

.invert-surface .btn--ghost:hover {
  border-color: var(--gold);
  background: transparent;
  color: var(--gold);
}

/* ---------------------------------------------------------- 刷毛の縁 */

/*
 * 縁のマスクは 91px 分の筆致しか持たないため、その上を不透明に保つ矩形を
 * 重ねる。1枚だけだと縁より上が消える。
 */
.brush-bottom {
  -webkit-mask-image:
    url(../images/mask/brush-edge-bottom.png),
    linear-gradient(#000, #000);
  mask-image:
    url(../images/mask/brush-edge-bottom.png),
    linear-gradient(#000, #000);
  -webkit-mask-size: 100% var(--brush-edge), 100% calc(100% - var(--brush-edge) + 1px);
  mask-size: 100% var(--brush-edge), 100% calc(100% - var(--brush-edge) + 1px);
  -webkit-mask-position: bottom center, top center;
  mask-position: bottom center, top center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

.brush-top {
  -webkit-mask-image:
    url(../images/mask/brush-edge-top.png),
    linear-gradient(#000, #000);
  mask-image:
    url(../images/mask/brush-edge-top.png),
    linear-gradient(#000, #000);
  -webkit-mask-size: 100% var(--brush-edge), 100% calc(100% - var(--brush-edge) + 1px);
  mask-size: 100% var(--brush-edge), 100% calc(100% - var(--brush-edge) + 1px);
  -webkit-mask-position: top center, bottom center;
  mask-position: top center, bottom center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

/*
 * セクション境界の斜め（13度）。
 * 後続セクションの色の面を疑似要素で前のセクションに食い込ませ、
 * skewY で傾ける。マスク画像は水平の縁しか持たないので変形で作る。
 * 1024px 未満では斜めにしない（SPは幅が足りない）。
 */
.veil-cut {
  position: relative;
  isolation: isolate;
}

/*
 * ヴェールはセクションと同じ色の面なので、下端がどこで終わっても見た目は
 * 変わらない。ただし本文の上に乗ってしまうため、中身を必ず上に出す。
 */
.veil-cut > .container {
  position: relative;
  z-index: 3;
}

.veil-cut::before {
  content: "";
  display: none;
  position: absolute;
  /* skewY は水平方向に動かないので、左右を広げる必要はない。
     広げると body の外に出て横スクロールが発生する。 */
  left: 0;
  right: 0;
  top: calc(var(--veil-rise, 240px) * -1);
  height: calc(var(--veil-rise, 240px) + 340px);
  z-index: 2;
  background: inherit;
  pointer-events: none;
  -webkit-mask-image: url(../images/mask/brush-edge-top.png), linear-gradient(#000, #000);
  mask-image: url(../images/mask/brush-edge-top.png), linear-gradient(#000, #000);
  -webkit-mask-size: 100% var(--brush-edge), 100% calc(100% - var(--brush-edge) + 1px);
  mask-size: 100% var(--brush-edge), 100% calc(100% - var(--brush-edge) + 1px);
  -webkit-mask-position: top center, bottom center;
  mask-position: top center, bottom center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

@media (min-width: 1024px) {
  .veil-cut {
    /*
     * --veil-rise が 170px（幅1440の半分 × tan13度）を超えていれば、
     * ヴェールはセクションの内側に入ってこない。上を空けるのは
     * 大きな斜めの直後に見出しを詰めないためで、食い込み対策ではない。
     */
    padding-top: calc(var(--section-y) + 40px);
  }

  .veil-cut::before {
    display: block;
    /* 中心を軸にすると、左右どちらの端も同じだけしか動かない。
       上端だけでなく下端も傾くが、下は同色の面の内側なので見えない。 */
    transform: skewY(calc(var(--angle-cut) * -1));
    transform-origin: center;
  }

  /* 右下がり。方向を交互にして単調さを避ける。 */
  .veil-cut--down::before {
    transform: skewY(var(--angle-cut));
  }
}

/*
 * 3箇所とも同じ筆致だと反復が見える。真ん中の境界だけ左右反転した
 * マスクを当て、飛沫の出る側を入れ替える。
 */
.veil-cut--flop::before {
  -webkit-mask-image: url(../images/mask/brush-edge-top-flop.png), linear-gradient(#000, #000);
  mask-image: url(../images/mask/brush-edge-top-flop.png), linear-gradient(#000, #000);
}

/* ヴェールに食われる分、直前のセクションの下を余分に空ける。 */
@media (min-width: 1024px) {
  .section--veil-after {
    padding-bottom: calc(var(--section-y) + 200px);
  }
}

/* ---------------------------------------------------------- header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: saturate(160%) blur(6px);
  border-bottom: var(--line-hair) solid var(--line);
  transition:
    background-color var(--dur-base) var(--ease),
    border-color var(--dur-base) var(--ease);
}

/*
 * ヒーローの上では地色を外す。ヒーロー側が負のマージンでヘッダーの下まで
 * 伸びているので、透過すると写真と濃紺がそのまま透ける。
 * 解除の判定は main.js（ヒーローの下端がヘッダーの高さを割ったら戻す）。
 */
.site-header.is-over-hero {
  background: transparent;
  border-bottom-color: transparent;
  backdrop-filter: none;
}

/* スマホでメニューを開いている間は、透過のままだと帯だけ写真が覗いて浮く。 */
body.nav-open .site-header {
  background: var(--navy-deep);
  border-bottom-color: var(--line-invert);
  backdrop-filter: none;
}

.site-header.is-over-hero .site-logo__mark,
body.nav-open .site-header .site-logo__mark {
  color: var(--paper);
}

.site-header.is-over-hero .site-logo__name,
body.nav-open .site-header .site-logo__name {
  color: rgba(255, 255, 255, .78);
}

.site-header.is-over-hero .site-nav__list a,
body.nav-open .site-header .site-nav__list a {
  color: var(--paper);
}

.site-header.is-over-hero .site-nav__list a:hover {
  color: var(--gold);
}

.site-header.is-over-hero .nav-toggle__bar,
body.nav-open .site-header .nav-toggle__bar {
  background: var(--paper);
}

/* 塗りつぶしのボタンは透過ヘッダーの上で浮くので、線だけにする。 */
.site-header.is-over-hero .site-header__cta {
  background: transparent;
  border-color: rgba(255, 255, 255, .55);
  color: var(--paper);
}

.site-header.is-over-hero .site-header__cta:hover {
  background: var(--paper);
  border-color: var(--paper);
  color: var(--navy);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: clamp(24px, 2.4vw, 40px);
  height: 100%;
}

/*
 * ロゴは左、ナビとボタンは右にまとめる。
 * justify-content: space-between だと3つの要素が均等に散り、
 * ナビだけが左右どちらにも属さない位置に浮く。
 */
.site-nav,
.nav-toggle {
  margin-left: auto;
}

.site-logo {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-decoration: none;
  color: inherit;
}

.site-logo__mark {
  font-family: var(--font-sans);
  font-weight: 700;
  font-style: italic;
  font-size: clamp(1.25rem, 2vw, 1.625rem);
  letter-spacing: .04em;
  line-height: 1;
  color: var(--ink-blue);
}

.site-logo__name {
  font-size: .625rem;
  letter-spacing: .22em;
  line-height: 1;
  color: var(--ink-muted);
}

/* インクブルーのロゴは濃紺の上で 2.46 しかない。反転面では白に置き換える。 */
.invert-surface .site-logo__mark,
.site-footer .site-logo__mark,
.mobile-nav .site-logo__mark {
  color: var(--paper);
}

.invert-surface .site-logo__name,
.site-footer .site-logo__name,
.mobile-nav .site-logo__name {
  color: rgba(255, 255, 255, .72);
}

.site-nav {
  display: none;
}

.site-nav__list {
  display: flex;
  align-items: center;
  gap: clamp(16px, 1.8vw, 32px);
}

.site-nav__list a {
  display: block;
  padding-block: var(--sp-2);
  font-size: .8125rem;
  letter-spacing: .08em;
  color: var(--ink);
  text-decoration: none;
}

.site-nav__list a:hover,
.site-nav__list .current-menu-item > a {
  color: var(--ink-blue);
}

.site-header__cta {
  display: none;
}

.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0 10px;
  background: none;
  border: 0;
}

.nav-toggle__bar {
  display: block;
  height: 1.5px;
  background: var(--ink);
  transition: transform var(--dur-base) var(--ease), opacity var(--dur-fast) var(--ease);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* スマホの展開メニュー */
.mobile-nav {
  position: fixed;
  inset: var(--header-h) 0 0;
  z-index: 99;
  padding: var(--sp-8) var(--gutter) var(--sp-10);
  background: var(--navy-deep);
  color: var(--paper);
  overflow-y: auto;
  transform: translateY(-8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-base) var(--ease), transform var(--dur-base) var(--ease), visibility var(--dur-base);
}

.mobile-nav.is-open {
  transform: none;
  opacity: 1;
  visibility: visible;
}

.mobile-nav__list a {
  display: block;
  padding: var(--sp-4) 0;
  border-bottom: var(--line-hair) solid var(--line-invert);
  font-family: var(--font-mincho);
  font-size: 1.125rem;
  letter-spacing: var(--ls-heading);
  color: var(--paper);
  text-decoration: none;
}

.mobile-nav__contact {
  margin-top: var(--sp-8);
  display: grid;
  gap: var(--sp-4);
}

.mobile-nav__tel {
  font-family: var(--font-num);
  font-size: 1.75rem;
  letter-spacing: var(--ls-num);
  color: var(--paper);
  text-decoration: none;
}

@media (min-width: 1024px) {
  .site-nav {
    display: block;
  }

  .site-header__cta {
    display: inline-flex;
  }

  .nav-toggle,
  .mobile-nav {
    display: none;
  }
}

/* ---------------------------------------------------------- footer */

.site-footer {
  background: var(--navy-deep);
  color: var(--paper);
  padding-block: var(--sp-9) var(--sp-6);
}

.site-footer__top {
  display: grid;
  gap: var(--sp-8);
}

.site-footer__meta {
  display: grid;
  gap: var(--sp-4);
  font-size: var(--fs-small);
  line-height: 1.9;
  color: rgba(255, 255, 255, .78);
}

.site-footer__meta a {
  color: rgba(255, 255, 255, .78);
  text-decoration: none;
}

.site-footer__meta a:hover {
  color: var(--gold);
}

.site-footer__sns {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
}

.site-footer__nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-5) var(--sp-6);
}

.site-footer__nav a {
  font-size: var(--fs-small);
  color: rgba(255, 255, 255, .78);
  text-decoration: none;
}

.site-footer__nav a:hover {
  color: var(--gold);
}

.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-top: var(--sp-9);
  padding-top: var(--sp-5);
  border-top: var(--line-hair) solid var(--line-invert);
  font-size: .6875rem;
  letter-spacing: .06em;
  color: rgba(255, 255, 255, .56);
}

@media (min-width: 768px) {
  .site-footer__nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .site-footer__top {
    grid-template-columns: 5fr 7fr;
    gap: var(--sp-10);
  }
}

/* ---------------------------------------------------------- breadcrumb */

.breadcrumb {
  padding-block: var(--sp-5);
  border-bottom: var(--line-hair) solid var(--line);
}

.breadcrumb__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-small);
  color: var(--ink-muted);
}

.breadcrumb__item + .breadcrumb__item::before {
  content: "／";
  margin-right: var(--sp-2);
  color: var(--line);
}

.breadcrumb__item a {
  text-decoration: none;
}
