/* =======================================================
   Layers（順序固定）
======================================================= */
@layer reset, tokens, base, layout, components, utilities, overrides;

/* ========== reset ========== */
@layer reset {
  * {
    box-sizing: border-box;
  }

  body,
  h1,
  h2,
  h3,
  p,
  ul {
    margin: 0;
    padding: 0;
  }

  ul {
    list-style: none;
  }

  a {
    text-decoration: none;
    color: inherit;
  }
}

/* ========== tokens ========== */
@layer tokens {
  :root {
    --header-h: 84px;
    --brand-font: "M PLUS Rounded 1c", "Noto Serif JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;

    /* mast sizes */
    --mast-en-size: clamp(40px, 7.2vw, 96px);
    /* adjusted minimum from 52px */
    --mast-ja-size: clamp(14px, 2.1vw, 26px);
    /* adjusted minimum from 18px */
    --mast-rule-width: clamp(160px, 28vw, 420px);

    /* card width (会社概要/お知らせ) */
    --card-max: 1160px;

    /* Services card */
    --svc-slide-radius: 18px;
  }
}

/* ========== base ========== */
@layer base {
  html {
    scroll-padding-top: calc(var(--header-h) + 12px);
    overflow-x: clip;
  }

  body {
    font-family: var(--brand-font);
    background: linear-gradient(to right, #3533cd, #000000);
    color: #ffffff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: var(--header-h);
    overflow-x: clip;
    /* 100vwはみ出し防止 */
  }

  main {
    flex: 1;
  }
}

/* ========== layout (Header / Footer) ========== */
@layer layout {
  header {
    background: linear-gradient(to right, #3533cd, #000000);
    padding: 15px 30px;
    position: fixed;
    inset: 0 0 auto 0;
    height: var(--header-h);
    z-index: 1000;
    border-bottom: 2px solid transparent;
    border-image-source: linear-gradient(135deg, #3533cd, #000000);
    border-image-slice: 1;
  }

  @media (max-width: 900px) {
    header {
      padding: 10px 15px;
      /* On mobile, headers with 2 stacked rows need a bit more height */
      height: calc(var(--header-h) + 30px);
    }

    body {
      padding-top: calc(var(--header-h) + 30px);
    }
  }

  .header-inner {
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  /* SP Header Layout Adjustment */
  @media (max-width: 900px) {
    .header-inner {
      flex-direction: column;
      justify-content: center;
      gap: 12px;
    }
  }

  .logo img {
    width: 250px;
    height: auto;
    display: block;
  }

  .header-nav ul {
    display: flex;
    gap: 25px;
  }

  @media (max-width: 900px) {
    .header-nav {
      width: 100%;
      overflow-x: auto;
      padding-bottom: 4px;
      /* Space for scrollbar */
      -webkit-overflow-scrolling: touch;
      scrollbar-width: none;
      /* Hide scrollbar Firefox */
    }

    .header-nav::-webkit-scrollbar {
      display: none;
      /* Hide scrollbar Chrome/Safari */
    }

    .header-nav ul {
      justify-content: flex-start;
      gap: 20px;
      padding: 0 10px;
      min-width: max-content;
    }
  }

  .header-nav a {
    color: #fff;
    font-weight: bold;
    font-size: 16px;
    white-space: nowrap;
  }

  .header-nav a:hover {
    color: #8fb6ff;
  }

  footer {
    background: linear-gradient(to right, #3533cd, #000000);
    color: #fff;
    padding: 30px;
    margin-top: 50px;
    text-align: center;
  }

  .footer-sns {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
  }

  .sns-link {
    font-size: 24px;
    color: #fff;
    transition: transform 0.3s ease, color 0.3s ease;
  }

  .sns-link:hover {
    transform: translateY(-3px);
    color: #8fb6ff;
  }
}

/* ========== components：Hero(Main Visual) ========== */
@layer components {
  body.home main {
    padding: 0;
  }

  /* Full-bleed & fullscreen */
  body.home .main-visual {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
  }

  body.home .main-visual.splide {
    height: calc(100vh - var(--header-h));
  }

  @supports (height: 100dvh) {
    body.home .main-visual.splide {
      height: calc(100dvh - var(--header-h));
    }
  }

  .main-visual .splide__track,
  .main-visual .splide__list,
  .main-visual .splide__slide {
    height: 100%;
  }

  .main-visual .splide__slide {
    position: relative;
  }

  .main-visual .splide__slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  /* 4枚目（三分割） */
  .tri-img {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    height: 100%;
  }

  .tri-img .panel {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  /* キャプション */
  .slide-caption {
    position: absolute;
    top: 65%;
    left: 3%;
    transform: translateY(-50%);
    z-index: 10;
    opacity: 0;
    transition: opacity .35s ease;
    pointer-events: none;
    text-align: left;
  }

  .slide-caption.is-active {
    opacity: 1;
  }

  .wipe-clip {
    display: inline-block;
    line-height: 1.2;
    font-weight: 800;
    color: #fff;
    font-size: clamp(20px, 6vw, 84px);
    /* dropped min from 26px */
    text-shadow: 0 2px 8px rgba(0, 0, 0, .55);
  }

  .wipe-clip>span {
    display: inline-block;
    clip-path: inset(0 100% 0 0);
    will-change: clip-path;
  }

  .slide-caption.is-active .wipe-clip>span {
    animation: revealX 1.1s ease-out .25s forwards;
  }

  @keyframes revealX {
    to {
      clip-path: inset(0 0 0 0);
    }
  }
}

/* ========== components：Mast / 見出し ========== */
@layer components {
  .mast {
    max-width: 1320px;
    margin: clamp(56px, 9vw, 100px) auto 14px;
    padding: 0 24px;
    color: #fff;
  }

  .mast--bleed {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    padding: 40px clamp(16px, 5vw, 72px) 8px;
  }

  .mast__en {
    font-size: var(--mast-en-size);
    font-weight: 800;
    line-height: 1.05;
    margin: 0;
  }

  .mast__ja {
    font-size: var(--mast-ja-size);
    font-weight: 800;
    margin: 6px 0 0;
  }

  .mast__rule {
    height: 5px;
    width: var(--mast-rule-width);
    background: rgba(255, 255, 255, .85);
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .12) inset, 0 1px 6px rgba(0, 0, 0, .14);
  }
}

/* ========== components：会社概要カード ========== */
@layer components {
  .about-brief {
    margin-top: clamp(36px, 10vh, 120px);
    padding: 0 24px 24px;
  }

  .ab-wrap {
    position: relative;
    max-width: var(--card-max);
    margin: 0 auto;
    background: rgba(255, 255, 255, .96);
    color: #0f172a;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, .25);
    padding: clamp(20px, 4.5vw, 48px);
    /* drop from 28px to 20 for more space */
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: clamp(16px, 3vw, 36px);
    /* drop slightly, 20px -> 16px */
    align-items: start;
    /* 写真がテキストの1行目と上揃えになるように追加 */
  }

  @media (max-width: 900px) {
    .ab-wrap {
      grid-template-columns: 1fr;
    }
  }

  .ab-eyebrow {
    display: none !important;
    grid-column: 1 / -1;
  }

  .ab-kicker {
    font-size: clamp(20px, 3.4vw, 36px);
    /* adjusted min from 26px */
    font-weight: 900;
    margin: 0 0 24px;
    grid-column: 1 / -1;
    /* 全幅を使用 */
    text-align: left;
  }

  .ab-body {
    font-size: clamp(14px, 1.15vw, 19px);
    /* adjusted min from 16px */
    line-height: 1.9;
  }

  .ab-figure {
    margin: 0;
    border-radius: 20px;
    overflow: hidden;
    outline: 1px solid rgba(2, 6, 23, .08);
    box-shadow: 0 10px 28px rgba(0, 0, 0, .16);
  }

  .ab-figure img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  .ab-rep {
    margin-top: 18px;
    display: flex;
    align-items: center;
    gap: 1em;
    justify-content: flex-end;
    text-align: right;
  }

  .ab-rep__role {
    font-size: 16px;
    letter-spacing: .08em;
    color: #475569;
    font-weight: 600;
    display: inline-block;
  }

  .ab-rep__name {
    font-size: clamp(20px, 2.4vw, 32px);
    /* min reduced from 24px */
    font-weight: 800;
    letter-spacing: .02em;
    display: inline-block;
  }

  .ab-cta {
    margin-top: clamp(24px, 5.5vw, 64px);
    /* dropped min slightly */
    display: flex;
    justify-content: center;
  }

  .btn-primary {
    display: inline-block;
    padding: 12px 22px;
    border-radius: 999px;
    background: #111;
    color: #fff !important;
    font-weight: 700;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
  }
}

/* ========== components：Services（カルーセル） ========== */
@layer components {
  .services {
    margin: clamp(56px, 10vh, 120px) auto;
  }

  /* サービスセクションの左右ガター（端の見切れ防止） */
  .sv-wrap {
    position: relative;
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 clamp(16px, 5vw, 56px);
    /* dropped from 24 to 16 */
  }

  /* Splideトラックは溢れ許可（左右のボケを見せるため） */
  .services-splide,
  .services-splide .splide__track {
    overflow: visible;
  }

  /* 非アクティブのぼかし */
  #services .splide__slide {
    transition: filter .35s ease, transform .35s ease, opacity .35s ease;
    transform: scale(.96);
    filter: blur(3px) brightness(.82);
    opacity: .85;
    display: flex;
    justify-content: center;
  }

  #services .splide__slide.is-active {
    transform: scale(1);
    filter: none;
    opacity: 1;
  }

  /* 16:9 カード（サイズ指定はここ“だけ”で管理） */
  .svc-card {
    width: clamp(840px, 70vw, 1100px);
    /* 画面に応じて縮小・拡大 */
    aspect-ratio: 16/9;
    border-radius: var(--svc-slide-radius);
    overflow: hidden;
    background: #fff;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .22), 0 3px 10px rgba(0, 0, 0, .12);
    position: relative;
  }

  .svc-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  .svc-chip {
    position: absolute;
    right: 18px;
    bottom: 18px;
    font-size: clamp(14px, 1.2vw + 0.2rem, 20px);
    padding: .65em 1em;
    border-radius: 999px;
    color: #fff;
    background: rgba(0, 0, 0, .64);
    box-shadow: 0 6px 20px rgba(0, 0, 0, .28);
    backdrop-filter: blur(2px);
  }

  /* 矢印（左右対称に見えるよう中央基準の内側） */
  .services-splide {
    position: relative;
  }

  .services-splide .splide__arrows {
    position: absolute;
    inset: 0;
    pointer-events: none;
  }

  .services-splide .splide__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: auto;
    z-index: 5;
    width: 44px;
    height: 44px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, .95);
    border: none;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .12);
  }

  .services-splide .splide__arrow--prev {
    left: 1.25rem;
  }

  .services-splide .splide__arrow--next {
    right: 1.25rem;
  }

  /* ← typo修正（.欠落） */
}

/* ========== components：News（カード幅合わせ） ========== */
@layer components {
  .news-brief {
    padding: 0 18px;
  }

  .nb-wrap {
    max-width: var(--card-max);
    margin: 0 auto;
    background: #fff;
    color: #111827;
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .12);
    padding: clamp(16px, 4.5vw, 38px);
    /* slightly dropped to fit */
  }

  .nb-list {
    border-top: 1px solid rgba(17, 24, 39, .12);
    margin: 0;
    padding: 0;
  }

  .nb-row {
    display: grid;
    grid-template-columns: 120px auto 1fr;
    align-items: center;
    gap: 14px;
    padding: 18px 8px;
    border-bottom: 1px solid rgba(17, 24, 39, .12);
  }

  .nb-date {
    font-variant-numeric: tabular-nums;
    color: #6b7280;
    font-size: clamp(14px, 1.2vw, 16px);
  }


  .nb-title {
    color: #111827;
    font-weight: 700;
    text-decoration: none;
    line-height: 1.7;
    font-size: clamp(14px, 1.3vw, 16px);
  }

  .nb-title:hover {
    text-decoration: underline;
  }

  .nb-cta {
    margin-top: 20px;
    text-align: center;
  }
}

/* ========== components：Contact Hero ========== */
@layer components {
  .contact-hero {
    position: relative;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    margin-top: clamp(56px, 10vh, 120px);
    margin-bottom: clamp(32px, 8vh, 64px);
    min-height: clamp(520px, 70vh, 900px);
    overflow: hidden;
  }

  .contact-hero .ch-bg {
    position: absolute;
    inset: 0;
  }

  .contact-hero .ch-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 40%;
    display: block;
    transform: scale(1.02);
  }

  .contact-hero .ch-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, .35) 0%, rgba(0, 0, 0, .35) 100%);
    pointer-events: none;
  }

  .contact-hero .ch-inner {
    position: relative;
    z-index: 1;
    height: 100%;
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    place-items: center;
    text-align: center;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, .35);
  }

  .ch-title {
    font-size: clamp(22px, 3.2vw, 32px);
    font-weight: 800;
    margin: 0 0 6px;
  }

  .ch-sub {
    margin: 0 0 14px;
    font-size: 12px;
    letter-spacing: .25em;
    opacity: .9;
  }

  .ch-desc {
    margin: 0 0 18px;
    line-height: 1.9;
    font-size: clamp(14px, 1.4vw, 16px);
  }

  .btn-contact {
    display: inline-block;
    padding: 12px 22px;
    border-radius: 999px;
    background: #111;
    color: #fff !important;
    font-weight: 700;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .25);
  }

  @media (max-width: 768px) {
    .contact-hero {
      min-height: clamp(420px, 58vh, 660px);
    }
  }
}

/* ========== utilities ========== */
@layer utilities {
  .reveal {
    --sr-duration: 0.9s;
    --sr-distance: 28px;
    --sr-ease: cubic-bezier(.2, .7, .2, 1);
    opacity: 0;
    transform: translateY(var(--sr-distance));
    transition: opacity var(--sr-duration) var(--sr-ease),
      transform var(--sr-duration) var(--sr-ease);
    will-change: opacity, transform;
  }

  .reveal.is-visible {
    opacity: 1;
    transform: none;
  }

  .u-text-right {
    text-align: right;
  }

  .u-d-block {
    display: block;
  }
}

/* ========== overrides ========== */
@layer overrides {

  /* Newsの縦書き事故防止 */
  #news-brief,
  #news-brief * {
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
  }
}

/* ========== Mast 見出しのワイプ復活 ========== */
.mast__rule {
  transform-origin: left center;
  transform: scaleX(0);
  opacity: 0;
}

.reveal-mast.is-visible .mast__rule {
  animation: mast-line-in .7s cubic-bezier(.2, .7, .2, 1) forwards;
}

@keyframes mast-line-in {
  0% {
    transform: scaleX(0);
    opacity: 0;
  }

  100% {
    transform: scaleX(1);
    opacity: 1;
  }
}

.mast__en>span {
  display: inline-block;
  clip-path: inset(100% 0 0 0);
  transform: translateY(8px);
}

.reveal-mast.is-visible .mast__en>span {
  animation: wipe-up .9s cubic-bezier(.2, .7, .2, 1) .08s forwards;
}

.mast__ja>span {
  display: inline-block;
  clip-path: inset(0 0 100% 0);
  transform: translateY(-6px);
  opacity: .98;
}

.reveal-mast.is-visible .mast__ja>span {
  animation: wipe-down .9s cubic-bezier(.2, .7, .2, 1) .16s forwards;
}

@keyframes wipe-up {
  0% {
    clip-path: inset(100% 0 0 0);
    transform: translateY(8px);
  }

  100% {
    clip-path: inset(0 0 0 0);
    transform: none;
  }
}

@keyframes wipe-down {
  0% {
    clip-path: inset(0 0 100% 0);
    transform: translateY(-6px);
  }

  100% {
    clip-path: inset(0 0 0 0);
    transform: none;
  }
}

/* ========== Services のリビールは opacity のみ（Splideに干渉しない） ========== */
#services .sv-wrap.reveal {
  transform: none !important;
}

#services .sv-wrap.reveal:not(.is-visible) {
  opacity: 0;
}

#services .sv-wrap.reveal.is-visible {
  opacity: 1;
  transition: opacity .8s ease;
}

/* アニメ抑制（ユーザー設定） */
@media (prefers-reduced-motion: reduce) {

  .reveal,
  .reveal-mast .mast__rule,
  .mast__en>span,
  .mast__ja>span {
    transition: none !important;
    animation: none !important;
    transform: none !important;
    clip-path: none !important;
    opacity: 1 !important;
  }
}

/* これだけ残す（重複の width:100% 指定は削除！） */
.services .svc-card {
  width: clamp(820px, 68vw, 1080px);
  aspect-ratio: 16/9;
  border-radius: 18px;
  overflow: hidden;
}

.services .svc-card>img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* トラックははみ出し可（ボケ見せるため） */
.services-splide .splide__track {
  overflow: visible;
}

/* 矢印サイズを元に（大きめに） */
.services-splide .splide__arrow {
  width: 56px;
  height: 56px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, .95);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .12);
}

/* 矢印の配置：padding(=8vw)を基準に左右対称
   56px の半分 28px を引いて、画像端に同じだけ重ねる */
.services-splide .splide__arrow--prev {
  left: calc(8vw - 28px);
}

.services-splide .splide__arrow--next {
  right: calc(8vw - 28px);
}

/* sv-wrap の左右パディングは左右対称・少なめに */
.sv-wrap {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 20px;
}

/* 矢印サイズはそのまま（56px） */
.services-splide .splide__arrow {
  width: 56px;
  height: 56px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, .95);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .12);
}

/* ← padding と揃える：left 7.6vw / right 9.6vw
   56px の半分(28px)だけ内側に寄せて、画像端への重なりを一定に */
.services-splide .splide__arrow--prev {
  left: calc(7.6vw - 28px);
}

.services-splide .splide__arrow--next {
  right: calc(9.6vw - 28px);
}

/* Services：下のボタンを中央＆下げる */
.services .sv-cta {
  display: flex;
  justify-content: center;
  /* 中央寄せ */
  margin-top: clamp(28px, 5vh, 80px);
  /* 画像からの余白を増やす */
}

/* 余白をさらにゆったり（次セクションとの間隔） */
.services {
  padding-bottom: clamp(40px, 8vh, 120px);
}

/* （任意）ボタン自体を少し大きく見やすく */
.services .sv-cta .btn-primary {
  padding: 14px 24px;
  font-weight: 800;
}

/* もし ID 指定があれば両方に適用（なければ不要） */
#services .sv-wrap.reveal,
#cases .sv-wrap.reveal {
  transform: none !important;
}

#services .sv-wrap.reveal:not(.is-visible),
#cases .sv-wrap.reveal:not(.is-visible) {
  opacity: 0;
}

#services .sv-wrap.reveal.is-visible,
#cases .sv-wrap.reveal.is-visible {
  opacity: 1;
  transition: opacity .8s ease;
}

/* ぼかし・スケール（中心だけくっきり） */
.services .splide__slide {
  transition: filter .35s ease, transform .35s ease, opacity .35s ease;
  transform: scale(.96);
  filter: blur(3px) brightness(.82);
  opacity: .85;
  display: flex;
  justify-content: center;
}

.services .splide__slide.is-active {
  transform: scale(1);
  filter: none;
  opacity: 1;
}

/* トラックを見切らせない（左右の“チラ見せ”を出す） */
.services .services-splide .splide__track {
  overflow: visible;
}

/* リビール時は opacity のみ（Splideに干渉しない） */
.services .sv-wrap.reveal {
  transform: none !important;
}

.services .sv-wrap.reveal:not(.is-visible) {
  opacity: 0;
}

.services .sv-wrap.reveal.is-visible {
  opacity: 1;
  transition: opacity .8s ease;
}

/* ==== Services / Seminar：ふわっと「上に浮く」演出 ==== */
/* 初期状態（セクションが未表示の間） */
.services .sv-wrap.reveal .svc-card {
  opacity: 0;
  transform: translate3d(0, 18px, 0);
  /* ほんの少し下から */
  box-shadow: 0 8px 18px rgba(0, 0, 0, .16);
  transition:
    opacity .70s cubic-bezier(.2, .7, .2, 1),
    transform .70s cubic-bezier(.2, .7, .2, 1),
    box-shadow .70s cubic-bezier(.2, .7, .2, 1);
  will-change: opacity, transform, box-shadow;
}

/* セクションが視界に入ったら：上に戻りつつ影をふくらませる */
.services .sv-wrap.reveal.is-visible .svc-card {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .22), 0 3px 10px rgba(0, 0, 0, .12);
}

/* （任意）ほんの少しステップ的に遅延させたい場合：左右の隣カードも気持ちよく */
.services .sv-wrap.reveal.is-visible .splide__slide:nth-child(1) .svc-card {
  transition-delay: .02s;
}

.services .sv-wrap.reveal.is-visible .splide__slide:nth-child(2) .svc-card {
  transition-delay: .04s;
}

.services .sv-wrap.reveal.is-visible .splide__slide:nth-child(3) .svc-card {
  transition-delay: .06s;
}

/* 以降必要なら増やしてOK */

/* ===== Contactヒーロー：テキストを画像のど真ん中＆大きく ===== */
.contact-hero .ch-inner {
  position: absolute;
  /* 画像全面にかぶせる */
  inset: 0;
  display: grid;
  place-items: center;
  /* 水平・垂直とも中央 */
  padding: 0 24px;
  text-align: center;
  gap: 18px;
  /* 説明文とボタンの間隔 */
}

.contact-hero .ch-desc {
  /* 文字を大きめ＆読みやすく */
  font-size: clamp(18px, 2.2vw, 26px);
  line-height: 1.9;
  max-width: 52ch;
  /* 横に伸びすぎないように適度に折り返し */
  margin: 0;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .35);
}

/* ボタンも少し大きく＆押しやすく */
.contact-hero .btn-contact {
  font-size: clamp(16px, 1.4vw, 18px);
  padding: 14px 28px;
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .28);
}

/* 読みやすさ向上のため背景の暗さをわずかに強めたい場合（任意） */
.contact-hero .ch-overlay {
  background: linear-gradient(180deg, rgba(0, 0, 0, .42) 0%, rgba(0, 0, 0, .42) 100%);
}

/* 好みで調整できるナッジ量（px） */
:root {
  --brand-nudge-y: 6px;
}

/* 4〜8pxくらいで微調整 */

.logo a {
  display: inline-flex;
  align-items: center;
  /* ロゴは中央、社名だけ下げる */
  gap: 16px;
}

.brand-text {
  font-size: clamp(18px, 2.4vw, 30px);
  font-weight: 900;
  letter-spacing: .02em;
  white-space: nowrap;
  line-height: 1;
  color: #fff;
  transform: translateY(var(--brand-nudge-y));
  /* ← ここで下げる */
}

/* 画面が狭い時はナッジ少なめに（バランス調整） */
@media (max-width: 900px) {
  .logo img {
    width: 220px;
  }

  :root {
    --brand-nudge-y: 5px;
  }
}

@media (max-width: 640px) {
  .logo img {
    width: 200px;
  }

  .brand-text {
    font-size: clamp(16px, 2.6vw, 26px);
  }

  :root {
    --brand-nudge-y: 4px;
  }
}

.contact-hero .ch-overlay {
  background: transparent;
}

/* ここまでは絶対修正しない */

/* 末尾どこでもOK */
.contact-form .form-submit {
  text-align: center;
}

.contact-form button,
button.btn-contact {
  cursor: pointer;
}

/* Staffのカード間を広めに取って、画面に基本1枚だけ映るバランスへ */
.staff-brief {
  margin-top: clamp(48px, 10vh, 120px);
  margin-bottom: clamp(56px, 12vh, 140px);
}

/* スタッフ名の見た目を少し強めに（代表カードと統一感） */
.staff-brief .ab-rep__name {
  font-weight: 800;
  font-size: clamp(22px, 2.2vw, 30px);
}

/* 上部固定ヘッダー分のアンカー余白（必要なら） */
#staff-1,
#staff-2 {
  scroll-margin-top: calc(var(--header-h) + 16px);
}

/* 見出しの降部(g,p,y)と下線がぶつからないように安全パディング */
.mast__en {
  line-height: 1.05;
  /* 既存と同等 */
  padding-bottom: 0.22em;
  /* ← ここを追加（降部の下に余白） */
}

.mast__rule {
  margin-top: 0.12em;
  /* 下線を少し離す */
}

/* 既定の下線幅を少しワイドに */
:root {
  --mast-rule-width: clamp(200px, 32vw, 560px);
}

/* 長い英単語向け（Company 等）にさらにワイドな幅を適用するクラス */
.mast--wide .mast__rule {
  width: clamp(260px, 42vw, 720px);
}

/* 既存：.mast__en > span / .mast__ja > span の初期値はそのままでOK */

/* ↓ これだけ置き換え（100%で負の inset を与えてクリップ余白を確保） */
@keyframes wipe-up {
  0% {
    clip-path: inset(100% 0 0 0);
    transform: translateY(8px);
  }

  100% {
    clip-path: inset(0 0 -10% 0);
    transform: none;
  }

  /* ← 尻尾が切れない */
}

@keyframes wipe-down {
  0% {
    clip-path: inset(0 0 100% 0);
    transform: translateY(-6px);
  }

  100% {
    clip-path: inset(0 0 -8% 0);
    transform: none;
  }

  /* ← 下側に余白を足す */
}

/* 念のため、行間と下線の間隔もちょい広げ（既に入れていれば不要） */
.mast__en {
  padding-bottom: .22em;
}

.mast__rule {
  margin-top: .12em;
}

/* ===== 見出しワイプの最終フレームを、さらに下へ広げる ===== */
@keyframes wipe-up {
  0% {
    clip-path: inset(100% 0 0 0);
    transform: translateY(8px);
  }

  100% {
    clip-path: inset(0 0 -18% 0 round 2px);
    transform: none;
  }

  /* -10% → -16% に拡大 */
}

@keyframes wipe-down {
  0% {
    clip-path: inset(0 0 100% 0);
    transform: translateY(-6px);
  }

  100% {
    clip-path: inset(0 0 -14% 0 round 2px);
    transform: none;
  }

  /* -8% → -14% に拡大 */
}

/* 安全マージンをほんの少しだけ増やす */
.mast__en {
  padding-bottom: 0.28em;
}

/* 0.22em → 0.28em */
.mast__rule {
  margin-top: 0.18em;
}

/* 0.12em → 0.18em */

/* 念のため：文字の描画が親で切られないように */
.mast,
.mast__en>span,
.mast__ja>span {
  overflow: visible;
}

/* ワイプ最終形：右側にも“はみ出し”余白をつけて横切れ防止 */
@keyframes wipe-up {
  0% {
    clip-path: inset(100% 0 0 0);
    transform: translateY(8px);
  }

  100% {
    clip-path: inset(0 -12% -22% 0 round 2px);
    transform: none;
  }

  /*          上 右   下    左   （右を -12%、下を -22% に広げる） */
}

@keyframes wipe-down {
  0% {
    clip-path: inset(0 0 100% 0);
    transform: translateY(-6px);
  }

  100% {
    clip-path: inset(-2% -10% -18% 0 round 2px);
    transform: none;
  }

  /*  日本語見出しも右側に -10% だけ余白（安全マージン） */
}

/* 右端でのにじみ分を吸収するため、英見出し行にわずかに右余白 */
.mast__en {
  padding-right: 0.08em;
  padding-bottom: 0.34em;
}

.mast,
.mast__en>span,
.mast__ja>span {
  overflow: visible;
}

/* 念のための保険 */

/* ▼ トグルボタン（カード中央下） */
.about-brief .bio-toggle-wrap {
  grid-column: 1 / -1;
  /* 両カラムにまたぐ */
  display: flex;
  justify-content: center;
  margin-top: clamp(16px, 2.4vw, 24px);
}

.bio-toggle {
  appearance: none;
  border: 0;
  background: transparent;
  color: #0f172a;
  font-weight: 800;
  letter-spacing: .02em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .10);
  background: rgba(255, 255, 255, .76);
  backdrop-filter: blur(2px);
}

.bio-toggle:hover {
  box-shadow: 0 8px 22px rgba(0, 0, 0, .14);
}

/* ▼ 下向き三角（シェブロン） */
.bio-toggle__chev {
  width: 14px;
  height: 14px;
  display: inline-block;
  border-right: 3px solid currentColor;
  border-bottom: 3px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  /* ▼ に見せる */
  transition: transform .25s ease;
}

/* 開いたら上向きに（180°回転） */
.bio-toggle[aria-expanded="true"] .bio-toggle__chev {
  transform: rotate(-135deg) translateY(1px);
}

/* ▼ 経歴パネル（スムーズ開閉アニメ） */
.bio-panel {
  grid-column: 1 / -1;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  padding: 0 6px;
  transition:
    max-height .45s cubic-bezier(.22, .7, .22, 1),
    opacity .35s ease,
    padding .35s ease;
  background: rgba(255, 255, 255, .92);
  border-radius: 12px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .10) inset;
  margin-top: 8px;
}

.bio-panel.is-open {
  opacity: 1;
  padding: 14px 18px;
  /* max-height は JS で内容の高さに合わせて都度セット */
}

.bio-title {
  margin: 0 0 8px;
  font-weight: 900;
  font-size: 16px;
  color: #0f172a;
}

.bio-list {
  margin: 0;
  padding-left: 1.2em;
  color: #1f2937;
  line-height: 1.9;
}

.bio-list li {
  margin: .2em 0;
}

/* 省アニメ設定に配慮 */
@media (prefers-reduced-motion: reduce) {
  .bio-panel {
    transition: none !important;
  }

  .bio-toggle__chev {
    transition: none !important;
  }
}

/* ===== Company Info（Map + Card） ===== */
.cmp-info {
  margin: clamp(56px, 10vh, 120px) auto;
  padding: 0 24px;
}

.cmp-wrap {
  max-width: 1320px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  /* 左：地図をやや大きく */
  gap: clamp(18px, 3.2vw, 32px);
  align-items: stretch;
}

/* Map：カード化しない（角丸＋影だけ軽く） */
.cmp-map {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .18);
  background: #0b1020;
}

.cmp-map iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: clamp(320px, 38vw, 520px);
  /* 充分な高さを確保 */
  border: 0;
}

/* 会社概要カード（右だけ白カード） */
.cmp-card {
  background: rgba(255, 255, 255, .96);
  color: #0f172a;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, .25);
  padding: clamp(20px, 3.6vw, 40px);
  /* adjusted from 24 */
  display: flex;
  flex-direction: column;
}

.cmp-title {
  margin: 0 0 14px;
  font-size: clamp(22px, 2.2vw, 28px);
  font-weight: 900;
  letter-spacing: .01em;
}

.cmp-list {
  margin: 0;
  display: grid;
  grid-template-columns: 140px 1fr;
  /* 項目名 / 値 */
  row-gap: 12px;
  column-gap: 18px;
}

.cmp-row {
  display: contents;
}

/* dt/dd をグリッドにそのまま流す */

.cmp-list dt {
  color: #334155;
  font-weight: 700;
  white-space: nowrap;
}

.cmp-list dd {
  margin: 0;
  line-height: 1.9;
}

/* レスポンシブ：モバイルは縦積み（マップ→カード） */
@media (max-width: 900px) {
  .cmp-wrap {
    grid-template-columns: 1fr;
  }

  .cmp-map iframe {
    min-height: clamp(280px, 46vw, 420px);
  }

  .cmp-list {
    grid-template-columns: 1fr;
    /* 項目名を上、値を下に */
  }

  .cmp-list dt {
    margin-top: 10px;
  }

  .cmp-list dd {
    margin-bottom: 6px;
  }
}

/* --- 会社情報：各行の下線（区切り）を追加 --- */

/* ② 行コンテナを“グリッド”に戻して、行ごとにボーダーを引く */
.cmp-row {
  display: grid;
  /* ← display: contents をやめる */
  grid-template-columns: 140px 1fr;
  /* 見出し / 値 */
  column-gap: 18px;
  align-items: start;
  padding: 10px 0;
  /* 上下の余白 */
  border-bottom: 1px solid rgba(15, 23, 42, .12);
  /* 下線（薄いグレー） */
}

/* 最後の行だけ下線を消す */
.cmp-row:last-child {
  border-bottom: 0;
}

/* 行内の dt / dd は余白リセット（見た目の詰まり防止） */
.cmp-list dt {
  margin: 0;
  padding-top: 2px;
  color: #334155;
  font-weight: 700;
  white-space: nowrap;
}

.cmp-list dd {
  margin: 0;
  line-height: 1.9;
}

/* ① 親グリッドは列定義だけ残す（そのままでもOK） */
.cmp-list {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  /* 行は .cmp-row が持つので1列扱いに */
  row-gap: 0;
}

/* モバイル：縦積み時の線はそのまま・レイアウトだけ変更 */
@media (max-width: 900px) {
  .cmp-row {
    grid-template-columns: 1fr;
    /* dt → dd を上下に */
    row-gap: 6px;
    padding: 12px 0;
  }

  .cmp-list dt {
    margin-top: 2px;
  }

  .cmp-list dd {
    margin-bottom: 4px;
  }
}

/* ===== 資格バッジ（名前の直後） ===== */
.ab-rep {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 1em;
  justify-content: flex-end;
  text-align: right;
  flex-wrap: wrap;
  /* 右寄せのまま折り返し可 */
}

/* 既存：役職 & 氏名（念のため残しておく） */
.ab-rep__role {
  font-size: 16px;
  letter-spacing: .08em;
  color: #475569;
  font-weight: 600;
  display: inline-block;
}

.ab-rep__name {
  font-size: clamp(24px, 2.4vw, 32px);
  font-weight: 800;
  letter-spacing: .02em;
  display: inline-block;
}

/* ▼ 資格見出し */
.ab-quals-heading {
  width: 100%;
  text-align: left;
  font-size: clamp(14px, 1.4vw, 18px);
  /* 氏名(24~32px)より小さく、資格名(12~14px)より大きい */
  font-weight: 800;
  color: #334155;
  margin-top: 24px;
  margin-bottom: 4px;
}

/* ▼ 資格リスト（バッジ） */
.ab-quals {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0;
  /* 見出しがあるので上余白リセット */
  padding: 0;
  list-style: none;
  justify-content: flex-start;
  /* 左寄せに変更（見出しに合わせる） */
  width: 100%;
}

.ab-quals li {
  font-size: clamp(12px, 1.1vw, 14px);
  font-weight: 700;
  color: #1f2937;
  background: #eef2ff;
  /* 薄いブルー */
  border: 1px solid rgba(67, 56, 202, .18);
  padding: 6px 10px;
  border-radius: 999px;
  /* ピル型 */
  box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
  white-space: nowrap;
}

/* 濃色テーマのカードでも読みやすいように微調整（必要なら） */
.ab-wrap {
  position: relative;
}

/* ===== 資格バッジ：薄いオレンジ系 ===== */
.ab-quals li {
  background: #FFE9D6;
  /* 薄いピーチ */
  border-color: rgba(234, 88, 12, .28);
  /* オレンジの薄い枠線 */
  color: #7C2D12;
  /* 文字は少し濃いブラウン寄り */
}

/* ホバー/フォーカス時は少しだけ濃くして可読性UP */
.ab-quals li:is(:hover, :focus-visible) {
  background: #FFDDBF;
  border-color: rgba(234, 88, 12, .38);
}

/* ===== 事業内容 詳細カード ===== */
.svc-detail-section {
  margin: clamp(40px, 7vh, 80px) auto;
  padding: 0 24px;
}

.svc-detail-card {
  max-width: var(--card-max);
  margin: 0 auto clamp(32px, 6vh, 72px);
  background: rgba(255, 255, 255, .96);
  color: #0f172a;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, .25);
  padding: clamp(20px, 4.5vw, 48px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(20px, 3vw, 40px);
  align-items: center;
  scroll-margin-top: 15vh;
  /* リンク遷移時に画面中央付近に表示させるための余白 */
  text-decoration: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.svc-detail-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 30px 60px rgba(0, 0, 0, .3);
}

.svc-detail-card:hover .svc-detail-card__text h3 {
  color: #4338ca;
}

/* 偶数番目は画像を左に */
.svc-detail-card:nth-child(even) {
  direction: rtl;
}

.svc-detail-card:nth-child(even)>* {
  direction: ltr;
}

.svc-detail-card__text h3 {
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 900;
  margin: 0 0 12px;
  color: #0f172a;
}

.svc-detail-card__text p {
  font-size: clamp(15px, 1.1vw, 18px);
  line-height: 1.9;
  color: #334155;
}

.svc-detail-card__text .svc-num {
  display: inline-block;
  font-size: 16px;
  font-weight: 800;
  color: #4338ca;
  background: #eef2ff;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 10px;
  letter-spacing: .06em;
}

.svc-detail-card__img {
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .16);
}

.svc-detail-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  aspect-ratio: 16/10;
}

@media (max-width: 900px) {
  .svc-detail-card {
    grid-template-columns: 1fr;
  }

  .svc-detail-card:nth-child(even) {
    direction: ltr;
  }
}

/* ===== お問い合わせフォーム強化 ===== */
.contact-form {
  max-width: 640px;
  margin: 0 auto;
}

.contact-form .form-group {
  margin-bottom: 22px;
}

.contact-form label {
  display: block;
  font-weight: 700;
  font-size: 15px;
  color: #0f172a;
  margin-bottom: 6px;
}

.contact-form label .req {
  color: #dc2626;
  font-size: 13px;
  margin-left: 4px;
  font-weight: 800;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form input[type="tel"],
.contact-form select,
.contact-form textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid rgba(15, 23, 42, .16);
  border-radius: 10px;
  font-size: 16px;
  font-family: inherit;
  background: #fff;
  color: #0f172a;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: #4338ca;
  box-shadow: 0 0 0 3px rgba(67, 56, 202, .12);
}

.contact-form textarea {
  resize: vertical;
  min-height: 160px;
}

.contact-form select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23334155' stroke-width='2' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

.contact-form .form-submit {
  margin-top: 28px;
}

.contact-form .btn-contact {
  display: inline-block;
  padding: 14px 36px;
  border-radius: 999px;
  background: #111;
  color: #fff !important;
  font-weight: 800;
  font-size: 16px;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .22);
  transition: background .2s ease, box-shadow .2s ease;
}

.contact-form .btn-contact:hover {
  background: #222;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .28);
}

.contact-form .privacy-note {
  margin-top: 14px;
  font-size: 13px;
  color: #64748b;
  line-height: 1.7;
}

/* ===== お知らせ一覧ページ強化 ===== */
.news-main.slim {
  padding: 0 24px;
  padding-top: clamp(30px, 5vh, 60px);
}

.news-wrap {
  max-width: var(--card-max);
  margin: 0 auto;
  background: rgba(255, 255, 255, .96);
  color: #0f172a;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, .25);
  padding: clamp(28px, 4.5vw, 48px);
}

.news-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.news-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #4338ca;
  flex-shrink: 0;
}

.news-h1 {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 900;
  color: #0f172a;
  margin: 0;
}

.news-sub {
  font-size: 13px;
  color: #64748b;
  letter-spacing: .15em;
  font-weight: 700;
  margin: 0;
}

.news-list-lines {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid rgba(15, 23, 42, .12);
}

.news-list-lines li {
  border-bottom: 1px solid rgba(15, 23, 42, .12);
}

.news-row {
  display: grid;
  grid-template-columns: 120px auto 1fr 24px;
  align-items: center;
  gap: 14px;
  padding: 18px 8px;
  color: #0f172a;
  text-decoration: none;
  transition: background .15s ease;
}

.news-row:hover {
  background: rgba(67, 56, 202, .04);
}

.news-date {
  font-variant-numeric: tabular-nums;
  color: #6b7280;
  font-size: 15px;
}

.news-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.news-tag--media {
  background: #eef2ff;
  color: #4338ca;
}

.news-tag--info {
  background: #ecfdf5;
  color: #059669;
}

.news-tag--seminar {
  background: #fdf2f8;
  color: #db2777;
}

.news-title {
  font-weight: 700;
  color: #111827;
  line-height: 1.6;
}

.news-arrow {
  color: #9ca3af;
  font-size: 18px;
}

/* ===== ニュース詳細ページ ===== */
.news-detail-main {
  padding: clamp(30px, 5vh, 60px) 24px;
}

.news-detail-main .container {
  max-width: 820px;
  margin: 0 auto;
  background: rgba(255, 255, 255, .96);
  color: #0f172a;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, .25);
  padding: clamp(28px, 4.5vw, 48px);
}

.breadcrumb {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 24px;
}

.breadcrumb a {
  color: #4338ca;
  font-weight: 600;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.news-detail-title {
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 900;
  margin: 0 0 8px;
  line-height: 1.5;
}

.news-detail-date {
  display: inline-block;
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(15, 23, 42, .12);
  width: 100%;
}

.news-content {
  line-height: 2.0;
  font-size: clamp(15px, 1.1vw, 17px);
}

.news-content p {
  margin: 0 0 18px;
}

.back-to-news {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid rgba(15, 23, 42, .12);
  text-align: center;
}

.back-to-news a {
  display: inline-block;
  padding: 12px 32px;
  border-radius: 999px;
  background: #111;
  color: #fff !important;
  font-weight: 700;
  text-decoration: none;
  font-size: 15px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .1);
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.back-to-news a:hover {
  text-decoration: underline;
}