:root {
  --color-primary: #008bd5;
  --color-secondary: #009844;
  --color-accent: #ffdc00;
  --color-text: #333333;
  --color-white: #ffffff;
  --content-width: 1100px;
  --header-desktop-height: 100px;
  --header-mobile-height: 75px;
}

* { box-sizing: border-box; }
html {
  font-size: 100%;
  scroll-behavior: smooth;
}

/*
 * Responsive rem baseline
 * Desktop: 100% (1rem = 16px)
 * Tablet/Mobile: 91.2% (1rem ≒ 14.6px)
 * ページ固有CSSでは、通常テキストはこの基準を継承し、
 * デザイン上必要な見出し・CTA等だけ個別に調整する。
 */
@media (max-width: 1023px) {
  html {
    font-size: 91.2%;
  }
}

body {
  margin: 0;
  font-size: 1rem;
  color: var(--color-text);
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  background: var(--color-white);
}

/* Astra separate-container background override */
body.ast-separate-container {
  background-color: var(--color-white);
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }

/* Header: トップページと同一。下層はHTML側でロゴをdivにする点のみ異なる */
.site-header {
  position: absolute;
  inset: 0 0 auto;
  z-index: 50;
  height: var(--header-desktop-height);
  pointer-events: none;
}

.site-header__inner {
  width: 100%;
  height: 100%;
  margin: 0;
  padding-left: 0;
  padding-right: 40px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.site-logo {
  width: 282px;
  height: 100px;
  margin: 0;
  padding: 0 26px 0 42px;
  display: flex;
  align-items: center;
  background: var(--color-white);
  border-radius: 0 0 22px 0;
  pointer-events: auto;
}
.site-logo a { display: block; width: 100%; }
.site-logo img { width: 100%; height: auto; }

.site-header__desktop {
  align-self: flex-end;
  height: 48px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 28px;
  pointer-events: auto;
}

.global-nav {
  display: flex;
  align-items: center;
  gap: 30px;
}
.global-nav a {
  color: var(--color-white);
  font-size: 1rem;
  font-weight: 700;
  text-shadow: 0 1px 4px rgb(0 0 0 / 35%);
  transition: opacity .2s ease;
}
.global-nav a:hover { opacity: .72; }

.header-cta-group { display: flex; gap: 12px; }
.site-cta {
  min-width: 154px;
  height: 48px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--color-white);
  border-radius: 24px;
  font-weight: 700;
  box-shadow: 0 7px 20px rgb(0 0 0 / 9%);
  transition: transform .2s ease, filter .2s ease;
}
.site-cta:hover { transform: translateY(-1px); filter: brightness(1.05); }
.site-cta--recruit { background: linear-gradient(90deg, #80C5EA 0%, var(--color-primary) 100%); }
.site-cta--contact { background: linear-gradient(90deg, #8DC21F 0%, var(--color-secondary) 100%); }
.site-cta__icon { font-size: 1.0625rem; line-height: 1; }
.menu-toggle { display: none; }
.mobile-drawer { display: none; }

@media (max-width: 1023px) and (min-width: 768px) {

  .site-logo {
    width: 238px;
    padding-left: 32px;
    padding-right: 20px;
  }

  .site-header__desktop {
    gap: 16px;
  }

  .global-nav {
    gap: 18px;
  }

  .site-cta {
    min-width: 128px;
    padding-inline: 14px;
    font-size: 0.96rem;
  }
}

@media (max-width: 767px) {
  .site-header {
    position: relative;
    inset: auto;
    width: 100%;
    height: var(--header-mobile-height);
    background: var(--color-white);
  }

  .site-header__inner {
    height: 75px;
    padding-right: 20px;
    align-items: center;
  }

  .site-logo {
    width: min(226px, calc(100vw - 96px));
    height: 75px;
    padding: 0 0 0 20px;
    border-radius: 20px 20px 0 0;
  }

  .site-header__desktop {
    display: none;
  }

  .menu-toggle {
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    display: grid;
    place-content: center;
    gap: 5px;
    background: linear-gradient(135deg, #8DC21F 0%, var(--color-secondary) 100%);
    color: var(--color-white);
    cursor: pointer;
    pointer-events: auto;
  }

  .menu-toggle span {
    width: 20px;
    height: 2px;
    display: block;
    border-radius: 99px;
    background: var(--color-white);
  }

  .mobile-drawer {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: block;
    visibility: hidden;
    opacity: 0;
    background: rgb(0 0 0 / 34%);
    transition: opacity .25s ease, visibility .25s ease;
  }

  .mobile-drawer.is-open {
    visibility: visible;
    opacity: 1;
  }

  .mobile-drawer__panel {
    position: absolute;
    top: 0;
    right: 0;
    width: min(86vw, 390px);
    height: 100%;
    padding: 0 24px 40px;
    background: var(--color-white);
    transform: translateX(100%);
    transition: transform .32s cubic-bezier(.2,.75,.3,1);
    overflow-y: auto;
  }

  .mobile-drawer.is-open .mobile-drawer__panel {
    transform: translateX(0);
  }

  .mobile-drawer__head {
    height: 75px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e8e8e8;
  }

  .mobile-drawer__head img {
    width: 190px;
  }

  .drawer-close {
    width: 42px;
    height: 42px;
    border: 0;
    background: transparent;
    color: var(--color-text);
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
  }

  .mobile-nav {
    padding-top: 22px;
  }

  .mobile-nav__links a {
    padding: 18px 2px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #dcdcdc;
    font-weight: 700;
  }

  .mobile-nav__cta {
    margin-top: 28px;
    display: grid;
    gap: 12px;
  }

  .mobile-nav__cta .site-cta {
    width: 100%;
    min-width: 0;
    height: 52px;
    font-size: 0.96rem;
  }

  body.is-menu-open {
    overflow: hidden;
  }
}

/* 共通英字見出し・スクロール表示 -------------------------------------- */
.section-heading {
  margin: 0;
  color: var(--color-primary);
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: .02em;
}

.section-subheading {
  margin: .5rem 0 0;
  color: var(--color-text);
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.5;
}

.section-heading--white,
.section-subheading--white {
  color: var(--color-white);
}

@media (max-width: 1023px) {
  .section-heading {
    font-size: 2.0625rem;
  }

  .section-subheading {
    font-size: 1.03rem;
  }
}

.heading-reveal {
  position: relative;
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
}

.heading-reveal__text {
  display: block;
  clip-path: inset(0 100% 0 0);
  transition: clip-path .9s cubic-bezier(.2,.75,.3,1) .08s;
}

.heading-reveal::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0 auto 0 0;
  width: 18%;
  min-width: 22px;
  background: currentColor;
  transform: translateX(-115%);
  opacity: .9;
  transition: transform 1s cubic-bezier(.2,.75,.3,1);
  pointer-events: none;
}

.heading-reveal.is-visible .heading-reveal__text { clip-path: inset(0 0 0 0); }
.heading-reveal.is-visible::after { transform: translateX(620%); }

.reveal {
  opacity: 0;
  transition: opacity .8s ease, transform .8s cubic-bezier(.2,.75,.3,1);
  will-change: opacity, transform;
}
.reveal--from-left { transform: translateX(-54px); }
.reveal--from-right { transform: translateX(64px); }
.reveal--fade-up { transform: translateY(36px); }
.reveal.is-visible { opacity: 1; transform: translate(0, 0); }

/* 全ページ共通 fade up */
.reveal-up {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .8s ease, transform .8s ease;
  will-change: opacity, transform;
}

.reveal-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-up {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .heading-reveal__text {
    clip-path: inset(0 0 0 0);
    transition: none;
  }

  .heading-reveal::after {
    display: none;
  }

  *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}

/* モバイル固定採用CTA --------------------------------------------------- */
.mobile-recruit-fixed { display: none; }

@media (max-width: 767px) {
  /* 固定採用CTAがフッター最下部へ重ならないよう全ページで高さを確保 */

  body {
    padding-bottom: 58px;
  }

  .mobile-recruit-fixed {
    position: fixed;
    z-index: 80;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    min-width: 0;
    height: 58px;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 26px 1fr 22px;
    align-items: center;
    gap: 12px;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 14px rgb(0 0 0 / 10%);
  }

  .mobile-recruit-fixed__arrow {
    text-align: right;
  }
}

/* Contact CTA / Footer ------------------------------------------------- */
.site-footer {
  background: var(--color-white);
}

.contact-cta {
  position: relative;
  overflow: hidden;
  min-height: 360px;
  padding: 72px 40px 70px;
  background: url("../img/common/contact-bg.webp") center center / cover no-repeat;
  color: var(--color-white);
}

.contact-cta__inner {
  width: min(100%, 1100px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.contact-cta__heading-group {
  text-align: center;
}

.contact-cta__title {
  display: inline-block;
}

.contact-cta__text {
  margin: 34px 0 0;
  color: var(--color-white);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.9;
  text-align: center;
}

.contact-cta__actions {
  margin-top: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
}

.contact-cta__button {
  min-width: 320px;
  min-height: 80px;
  padding: 12px 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  border-radius: 20px;
  background: var(--color-white);
  color: var(--color-primary);
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1.4;
  box-shadow: 0 10px 24px rgb(0 0 0 / 12%);
  transition: transform .2s ease, box-shadow .2s ease;
}

.contact-cta__button i {
  font-size: 1.5rem;
}

.contact-cta__button:hover,
.contact-cta__button:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgb(0 0 0 / 18%);
}

@media (max-width: 1023px) and (min-width: 768px) {
  .contact-cta {
    min-height: 330px;
    padding: 62px 32px 60px;
  }

  .contact-cta__text {
    margin-top: 28px;
  }

  .contact-cta__actions {
    margin-top: 30px;
    gap: 22px;
  }

  .contact-cta__button {
    font-size: 1.25rem;
  }

  .contact-cta__button i {
    font-size: 1.25rem;
  }
}

@media (max-width: 767px) {
  .contact-cta {
    min-height: 0;
    padding: 50px 20px 52px;
    background-position: 62% center;
  }

  .contact-cta__inner {
    align-items: stretch;
  }

  .contact-cta__text {
    margin-top: 24px;
    line-height: 1.85;
    text-align: left;
  }

  .contact-cta__actions {
    margin-top: 28px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .contact-cta__button {
    width: 100%;
    min-width: 0;
    min-height: 52px;
    padding: 10px 20px;
    font-size: 1.25rem;
  }

  .contact-cta__button i {
    font-size: 1.25rem;
  }
}

/* Footer Bottom -------------------------------------------------------- */
.footer-bottom {
  padding: 38px 40px 22px;
  background: var(--color-white);
  color: var(--color-text);
}

.footer-bottom__inner {
  width: min(100%, 1100px);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
}

.footer-bottom__brand {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
}

.footer-bottom__logo {
  display: block;
  width: 220px;
}

.footer-bottom__logo img {
  width: 100%;
  height: auto;
}

.footer-bottom__privacy {
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.5;
  transition: opacity .2s ease;
}

.footer-bottom__privacy:hover,
.footer-bottom__privacy:focus-visible {
  opacity: .65;
}

.footer-nav {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 34px;
}

.footer-nav__links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.footer-nav__links a {
  font-size: 1rem;
  font-weight: 400;
  white-space: nowrap;
  transition: opacity .2s ease;
}

.footer-nav__links a:hover,
.footer-nav__links a:focus-visible {
  opacity: .65;
}

.footer-nav__cta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-nav__cta .site-cta {
  min-width: 140px;
  height: 44px;
  padding-inline: 16px;
  border-radius: 22px;
  font-size: 0.8125rem;
}

.footer-nav__cta .site-cta__icon {
  font-size: 0.9375rem;
}

.footer-bottom__copyright {
  width: min(100%, 1100px);
  margin: 26px auto 0;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.5;
  text-align: center;
}

@media (max-width: 1023px) and (min-width: 768px) {
  .footer-bottom {
    padding: 32px 32px 20px;
  }

  .footer-bottom__inner {
    gap: 28px;
  }

  .footer-bottom__logo {
    width: 190px;
  }

  .footer-nav {
    gap: 20px;
  }

  .footer-nav__links {
    gap: 18px;
  }

  .footer-nav__cta {
    gap: 8px;
  }

  .footer-nav__cta .site-cta {
    min-width: 116px;
    height: 42px;
    padding-inline: 12px;
  }

  .footer-bottom__copyright {
    margin-top: 22px;
  }
}

@media (max-width: 767px) {
  .footer-bottom {
    padding: 30px 20px 22px;
  }

  .footer-bottom__inner {
    display: grid;
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .footer-bottom__brand {
    align-items: center;
  }

  .footer-bottom__logo {
    width: 190px;
  }

  .footer-nav {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .footer-nav__links {
    justify-content: center;
    gap: 22px;
  }

  .footer-nav__cta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .footer-nav__cta .site-cta {
    width: 100%;
    min-width: 0;
    height: 46px;
    padding-inline: 10px;
  }

  .footer-bottom__copyright {
    margin-top: 24px;
  }
}

/* Astraグローバルリンクhoverの個別調整 ------------------------------- */
/*
 * Astra側の a:hover の色指定は通常リンクでは活かしつつ、
 * 白文字を前提とするリンク・CTAのみ子テーマ側で文字色を維持する。
 */
.global-nav a:hover,
.global-nav a:focus-visible,
.site-cta:hover,
.site-cta:focus-visible,
.section-link--white:hover,
.section-link--white:focus-visible,
.works-card:hover,
.works-card:focus-visible,
.works-section__more:hover,
.works-section__more:focus-visible {
  color: var(--color-white);
}

/* Astra側のリンク色よりCTAの白文字を優先する */
a.site-cta,
a.site-cta:visited,
a.site-cta:hover,
a.site-cta:focus-visible {
  color: var(--color-white);
}

/* フッターのプライバシーポリシーはhover時も色と下線を維持 */
.footer-bottom__privacy,
.footer-bottom__privacy:visited,
.footer-bottom__privacy:hover,
.footer-bottom__privacy:focus-visible {
  color: var(--color-text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* 下層ページ共通Hero */
.subpage-hero {
  width: 100%;
  padding: 0 0 18px;
}

.subpage-hero__visual {
  position: relative;
  width: 100%;
}

.subpage-hero__visual picture,
.subpage-hero__visual picture img {
  display: block;
  width: 100%;
}

.subpage-hero__visual picture img {
  height: auto;
  max-width: none;
  border-radius: 20px 20px 0 0;
}

.subpage-hero__title-panel {
  position: absolute;
  left: max(40px, calc((100vw - var(--content-width)) / 2));
  bottom: -18px;
  width: fit-content;
  max-width: calc(100% - 80px);
  min-height: 132px;
  padding: 24px 34px 18px;
  background: var(--color-white);
  border-radius: 24px 24px 0 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.subpage-hero__en {
  margin: 0 0 4px;
  color: var(--color-primary);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: .01em;
}

.subpage-hero__title {
  margin: 0;
  color: var(--color-text);
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: .01em;
}

/* Tablet: Hero写真を隠しすぎないよう見出し・パネルを一段小さくする */
@media (max-width: 1023px) and (min-width: 768px) {
  .subpage-hero__title-panel {
    left: 32px;
    max-width: calc(100% - 64px);
    min-height: 92px;
    padding: 16px 24px 18px;
    border-radius: 20px 20px 0 0;
  }

  .subpage-hero__en {
    margin-bottom: 3px;
    font-size: 1rem;
  }

  .subpage-hero__title {
    font-size: 1.75rem;
    line-height: 1.3;
  }
}

@media (max-width: 767px) {
  .subpage-hero {
    padding-bottom: 12px;
  }

  .subpage-hero__title-panel {
    left: 18px;
    bottom: -12px;
    max-width: calc(100% - 36px);
    min-height: 76px;
    padding: 12px 18px 12px;
    border-radius: 18px 18px 0 0;
  }

  .subpage-hero__en {
    margin-bottom: 2px;
    font-size: 0.875rem;
  }

  .subpage-hero__title {
    font-size: 1.5rem;
    line-height: 1.3;
  }
}

/* Mobile: Astra scroll-to-top button avoids fixed recruitment CTA */
@media (max-width: 767px) {
  #ast-scroll-top {
    bottom: 70px;
  }
}

/* 共通セクションリンク -------------------------------------------------- */
.section-link {
  width: 15.625rem;
  padding: 0 0.625rem 0.625rem;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid currentColor;
  color: var(--color-primary);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.5;
  text-decoration: none;
  transition: opacity 0.25s ease;
}

.section-link:hover,
.section-link:focus-visible {
  color: var(--color-primary);
  opacity: 0.72;
}

.section-link i {
  flex: 0 0 auto;
  font-size: 0.9375rem;
  transition: transform 0.25s ease;
}

.section-link:hover i,
.section-link:focus-visible i {
  transform: translateX(0.375rem);
}

.section-link--white,
.section-link--white:visited {
  color: var(--color-white);
}

.section-link--dark,
.section-link--dark:visited,
.section-link--dark:hover,
.section-link--dark:focus-visible {
  color: var(--color-text);
}

@media (max-width: 1023px) {
  .section-link {
    font-size: 0.96rem;
  }
}

/* Heroを持たないNEWS singleでは共通ヘッダーを白背景上で表示する。 */
body.single-post .site-header {
  position: relative;
  inset: auto;
  background: var(--color-white);
}

body.single-post .global-nav a {
  color: var(--color-text);
  text-shadow: none;
}
