/* --- Variables --- */
:root {
  --color-primary: #1d2c4b;
  --color-accent: #c8a961;
  --color-accent-dark: #cbac64;
  --color-white: #ffffff;
  --color-black: #000000;
  --color-gray-light: #f5f5f5;
  --color-gray: #f0f0f0;
  --color-dark-blue:#1D2C4B;
  --color-link-active: #1a6aff;

  --font-serif: 'Hedvig Letters Serif', serif;
  --font-sans: 'Inter', 'Noto Sans JP', sans-serif;
  --font-en: 'Hedvig Letters Serif', serif;
  --font-jp: 'Noto Sans JP', sans-serif;

  --max-width: 75rem;       /* 1200px */
  --content-width: 80%; /* 980px */
}

/* --- Fluid root font-size ---
   320px → 14px,  1280px → 16px
   clamp(0.875rem, 0.75rem + 0.2083vw, 1rem) を使い、
   1rem が 14〜16px の間でスケール                            */
html {
  font-size: clamp(10px, 0.75rem + 0.2083vw, 16px);
  scroll-behavior: smooth;
}

/* --- Fade-in Animation ---
   .js-fade-in をつけた要素が画面内に入ったときフェードインする。
   遅延は data-delay="200" のように ms 単位で指定できる（省略可）。
   ========================================================================== */
.js-fade-in {
  opacity: 0;
  transform: translateY(3rem);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.js-fade-in.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Reset --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  color: var(--color-black);
  line-height: 1.8;
  background: var(--color-white);
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

ul {
  list-style: none;
}

.pc {
  display: block;
}

.sp {
  display: none;
}

@media (max-width: 768px) {
  .pc {
    display: none;
  }

  .sp {
    display: block;
  }
}

/* ==========================================================================
   SHARED COMPONENTS (BEM)
   ========================================================================== */

/* --- Section Heading --- */
.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: center;
  font-size: 1.68rem;
  letter-spacing: 0.39rem;
  line-height: 1.5;
  white-space: nowrap;
}

.section-heading__en {
  font-family: var(--font-en);
  font-weight: 400;
  color: var(--color-accent);
}

.section-heading__divider {
  font-family: var(--font-sans);
  color: var(--color-black);
  margin: 0 0.125rem;
}

.section-heading__ja {
  font-family: var(--font-serif);
  font-weight: 400;
  color: var(--color-black);
}

/* --- Button --- */
.btn {
  display: inline-block;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  transition: opacity .3s;
}

.btn:hover {
  opacity: .85;
}

.btn--primary {
  background: var(--color-primary);
  color: var(--color-white);
  font-family: var(--font-en);
  font-size: 1.6rem;
  line-height: 1.5;
  padding: .5rem 0;
  border-radius: 9999px;
  width: 34rem;
  max-width: 100%;
}

.btn--contact {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  line-height: 2;
}

.btn--outline {
  background: var(--color-white);
  color: var(--color-primary);
  border: 0.167rem solid var(--color-primary);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6rem;
  padding: 1rem 0;
  width: 18.75rem;
  max-width: 100%;
}

/* --- Page Banner --- */
.page-banner {
  width: 100%;
  height: 20rem;
  overflow: hidden;
}

.page-banner__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --- Page Heading --- */
.page-heading {
  background: var(--color-gray-light);
  max-width: var(--content-width);
  margin: -3.5rem auto 0;
  position: relative;
  z-index: 1;
  padding: 3.44rem 2.5rem;
  text-align: center;
}

.page-heading--gray {
  background: var(--color-gray);
}

.page-heading__sub {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  letter-spacing: .5rem;
  margin-top: .5rem;
}

/* --- Title Divider --- */
.title-divider {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.title-divider__line {
  flex: 1;
  height: .125rem;
  background: var(--color-primary);
}

.title-divider__line--light {
  background: var(--color-white);
}

/* --- Works Grid --- */
.works-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
  max-width: 56.25rem;
  margin: 4rem auto 0;
  padding: 0 1.5rem;
}

.works-grid__item {
  text-align: center;
}

.works-grid__img-wrapper {
  width: 100%;
  height: 13.5rem;
  overflow: hidden;
}

.works-grid__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.works-grid__caption {
  font-size: 1rem;
  line-height: 2rem;
  letter-spacing: .25rem;
  margin-top: .75rem;
}

/* --- Page Main (fixed-header offset) --- */
.page-main {
  margin-top: 2.8125rem;
}

@media (max-width: 768px) {
  .page-heading__sub {
    font-size: .9rem;
  }

  .works-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }
}

@media (max-width: 480px) {
  .works-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3.2rem;
  background: var(--color-white);
  z-index: 1000;
}

.header__inner {
  display: flex;
  align-items: center;
  height: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.header__logo {
  flex-shrink: 0;
}

.header__logo-img {
  height: 1.7rem;
  width: auto;
}

.header__nav {
  margin-left: auto;
  margin-right: 1.5rem;
}

.header__nav-list {
  display: flex;
  gap: 2rem;
}

.header__nav-item {
  position: relative;
}

.header__nav-link {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 400;
  color: var(--color-black);
  line-height: 1.5;
  padding-bottom: .25rem;
  position: relative;
  display: block;
}

.header__nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--color-black);
  transform: scaleX(0);
  transition: transform .3s;
}

.header__nav-link:hover::after,
.header__nav-item--active .header__nav-link::after {
  transform: scaleX(1);
}

.header__nav-item--active .header__nav-link {
  color: var(--color-link-active);
}

.header__nav-item--active .header__nav-link::after {
  background: var(--color-link-active);
}

.header__cta {
  background: var(--color-accent-dark);
  color: var(--color-white);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  padding: .75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  margin-right: -1.5rem;
  flex-shrink: 0;
  transition: opacity .3s;
}

.header__cta:hover {
  opacity: .85;
}

/* --- Hamburger button --- */
.header__hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: .35rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: .25rem;
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
}

.header__hamburger span {
  display: block;
  width: 1.5rem;
  height: 2px;
  background: var(--color-primary);
  border-radius: 1px;
  transition: transform .3s ease, opacity .3s ease;
  transform-origin: center;
}

/* --- Mobile nav overlay --- */
.header__mobile-nav {
  position: fixed;
  top: 2.8125rem;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-primary);
  z-index: 995;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  transform: translateX(100%);
  transition: transform .35s ease;
}

.header__mobile-nav-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5rem;
  width: 100%;
}

.header__mobile-nav-item {
  width: 100%;
  text-align: center;
}

.header__mobile-nav-link {
  font-family: var(--font-sans);
  font-size: 1.125rem;
  letter-spacing: .15rem;
  color: var(--color-white);
  display: block;
  padding: .5rem 0;
}

.header__mobile-nav-item--active .header__mobile-nav-link {
  color: var(--color-accent);
}

.header__mobile-cta {
  display: inline-block;
  margin-top: 3rem;
  background: var(--color-accent-dark);
  color: var(--color-white);
  font-family: var(--font-sans);
  font-size: 1rem;
  padding: .85rem 3rem;
  border-radius: .25rem;
  letter-spacing: .1rem;
  transition: opacity .3s;
}

.header__mobile-cta:hover {
  opacity: .85;
}

/* --- Open state --- */
html.nav-open {
  overflow: hidden;
}

html.nav-open .header__mobile-nav {
  transform: translateX(0);
}

html.nav-open .header__hamburger span:nth-child(1) {
  transform: translateY(calc(.35rem + 2px)) rotate(45deg);
}

html.nav-open .header__hamburger span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

html.nav-open .header__hamburger span:nth-child(3) {
  transform: translateY(calc(-.35rem - 2px)) rotate(-45deg);
}

/* ==========================================================================
   CONTACT SECTION  (shared across pages)
   ========================================================================== */
.contact {
  position: relative;
  height: 37.5rem;
  overflow: hidden;
}

.contact__bg {
  position: absolute;
  inset: 0;
}

.contact__bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.contact__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  padding: 0 1.5rem;
}

.contact__text {
  font-size: 1rem;
  line-height: 2rem;
  letter-spacing: .25rem;
  margin-top: 5rem;
}

.contact__cta {
  margin-top: 5rem;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer {
  background: var(--color-white);
  padding: 1rem 0;
}

.footer__inner {
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer__company-name {
  font-size: 1.5625rem;
  line-height: 1.4;
}

.footer__info-text {
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.4;
}

.footer__copyright {
  margin-left: auto;
  align-self: center;
}

.footer__copyright-text {
  font-family: var(--font-serif);
  font-size: .875rem;
}

/* ==========================================================================
   PAGE-LEVEL BANNER + HEADING (shared pattern)
   ========================================================================== */
.page-banner {
  width: 100%;
  height: 19rem;
  overflow: hidden;
}

.page-heading {
  background: var(--color-gray-light);
  max-width: var(--content-width);
  margin: -3.5rem auto 0;
  position: relative;
  z-index: 1;
  padding: 1.875rem 2.5rem;
  text-align: center;
}

.page-heading__sub {
  font-family: var(--font-serif);
  font-size: 1rem;
  letter-spacing: .5rem;
  margin-top: 1.25rem;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1024px) {
  .section-heading {
    font-size: 1.25rem;
    letter-spacing: .25rem;
  }

}

@media (max-width: 768px) {
  .header__nav {
    display: none;
  }

  .header__cta {
    margin-right: 0;
    margin-left: auto;
    font-size: .65rem;
    padding: .5rem .75rem;
    height: auto;
    line-height: 1.2;
  }

  .header__hamburger {
    display: flex;
  }

  .section-heading {
    letter-spacing: .2rem;
  }

  .page-heading__sub {
    font-size: 0.9rem;
  }

  .btn--primary {
    width: 17.5rem;
    font-size: 1.125rem;
  }

  .footer__inner {
    flex-direction: column;
  }

  .footer__copyright {
    margin-left: 0;
  }

}
