:root {
    --white: #ffffff;
    --theme-font-base: "Inter", "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
    --theme-font-heading: "Georgia", "Times New Roman", "Hiragino Mincho ProN", "Yu Mincho", serif;
    --service-theme-bg: #fffbf7;
    --service-theme-bg-alt: #f7ede2;
    --service-theme-surface: #ffffff;
    --service-theme-surface-alt: #f5ede4;
    --service-theme-heading: #2b2320;
    --service-theme-text: #5f554d;
    --service-theme-accent: #b18962;
    --service-theme-accent-strong: #9d714b;
    --service-theme-accent-soft: #eadccf;
    --service-theme-border: #e8dccf;
    --service-theme-shadow: rgba(82, 54, 33, 0.08);
  }
  
  * { box-sizing: border-box; }
  html { scroll-behavior: smooth; }
  body {
    margin: 0;
    min-height: 100vh;
    background: var(--service-theme-bg);
    color: var(--service-theme-heading);
    font-family: var(--theme-font-base);
  }
  img { max-width: 100%; height: auto; display: block; }
  a { color: inherit; }
  .inner {
    width: min(calc(100% - 40px), var(--container));
    margin: 0 auto;
  }
  
  /* Static preview header */
  .preview-header {
    position: fixed;
    z-index: 100;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(11, 22, 38, 0.94);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    color: #fff;
  }
  .preview-header__inner {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .preview-header__logo {
    font-weight: 700;
    letter-spacing: 0.08em;
  }
  .preview-header__nav {
    display: flex;
    gap: 26px;
    font-size: 0.86rem;
    color: rgba(255,255,255,0.78);
  }
  .preview-header__nav span.is-current { color: #fff; }
  
  /* Shared lead */
  .works-page {
    background: var(--service-theme-bg);
    overflow: hidden;
  }

  /* ---------------------------------
  Works page
  --------------------------------- */
  .works-lead {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 420px;
  }

  .works-lead__inner {
    width: 100%;
    padding-top: calc(var(--header-height, 88px) + 12px);
  }
  .works-lead__content {
    max-width: 760px;
    padding: 30px;
  }
  .works-lead__eyebrow {
    margin: 0 0 14px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--service-theme-accent);
  }
  
  .works-lead__title {
    margin: 0 0 20px;
    font-family: var(--theme-font-heading);
    font-size: var(--page-title-font-size);
    line-height: 1.08;
    letter-spacing: 0.03em;
    color: var(--service-theme-heading);
  }
  
  .works-lead__text {
    max-width: 760px;
    margin: 0;
    font-size: 1rem;
    line-height: 2;
    color: var(--service-theme-text);
  }

  .works-lead__note {
    margin-top: 22px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 999px;
    background: var(--service-theme-accent-soft);
    color: var(--service-theme-accent-strong);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
  }
  
  /* A: Photo gallery */
  .gallery-intro {
    padding: 0 0 42px;
  }
  .gallery-intro__box {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 52px;
    align-items: end;
    padding: 48px;
    border-top: 1px solid var(--service-theme-border);
    border-bottom: 1px solid var(--service-theme-border);
  }
  .gallery-intro__label {
    margin: 0 0 12px;
    color: var(--service-theme-accent-strong);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
  }
  .gallery-intro__title {
    margin: 0;
    font-family: var(--theme-font-heading);
    font-size: clamp(1.9rem, 3vw, 3.2rem);
    line-height: 1.25;
  }
  .gallery-intro__text {
    margin: 0;
    color: var(--service-theme-text);
    line-height: 2;
  }
  
.gallery-mosaic {
  padding: 24px 0 120px;
}

.gallery-mosaic > .inner {
  width: min(calc(100% - 64px), 1380px);
  margin-inline: auto;
}

.gallery-mosaic__grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-rows: 105px;
  grid-auto-flow: dense;
  gap: 16px;
  width: 100%;
}

.gallery-photo {
  position: relative;
  min-width: 0;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  border-radius: 18px;
  background: var(--service-theme-surface-alt);
  box-shadow: 0 14px 34px var(--service-theme-shadow);
  isolation: isolate;
}

.gallery-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(
      180deg,
      transparent 45%,
      rgba(20, 16, 14, 0.08) 62%,
      rgba(20, 16, 14, 0.62) 100%
    );
  pointer-events: none;
}

.gallery-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition:
    transform 0.55s ease,
    filter 0.55s ease;
}

.gallery-photo:hover img {
  transform: scale(1.045);
  filter: saturate(1.04);
}

/*
 * 雑誌風レイアウト
 *
 * 1〜3件目：左側に大写真
 * 4〜5件目：横並びの中写真
 * 6〜8件目：右側に大写真
 */
.gallery-photo:nth-child(8n + 1) {
  grid-column: 1 / span 4;
  grid-row: span 4;
}

.gallery-photo:nth-child(8n + 2),
.gallery-photo:nth-child(8n + 3) {
  grid-column: 5 / span 2;
  grid-row: span 2;
}

.gallery-photo:nth-child(8n + 4) {
  grid-column: 1 / span 3;
  grid-row: span 2;
}

.gallery-photo:nth-child(8n + 5) {
  grid-column: 4 / span 3;
  grid-row: span 2;
}

.gallery-photo:nth-child(8n + 6),
.gallery-photo:nth-child(8n + 7) {
  grid-column: 1 / span 2;
  grid-row: span 2;
}

.gallery-photo:nth-child(8n + 8) {
  grid-column: 3 / span 4;
  grid-row: span 4;
}

.gallery-photo__caption {
  position: absolute;
  z-index: 2;
  left: 22px;
  right: 22px;
  bottom: 18px;
  margin: 0;
  color: rgba(255, 255, 255, 0.98);
  font-size: clamp(0.82rem, 1.2vw, 1rem);
  font-weight: 700;
  line-height: 1.55;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.48);
}

  .gallery-cta {
    margin-top: 54px;
    padding: 34px 38px;
    display: flex;
    justify-content: space-between;
    gap: 32px;
    align-items: center;
  }
  .gallery-cta p {
    margin: 0;
    color: var(--service-theme-text);
    line-height: 1.9;
  }
  .gallery-cta__link {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 180px;
    min-height: 52px;
    padding: 14px 24px;
    border-radius: 999px;
    background: #4f5b49;
  
    color: #fff;
    text-decoration: none;
    font-weight: 700;
  }
  
  /* B: Case study */
  .case-notice {
    padding: 0 0 32px;
  }
  .case-notice__box {
    padding: 22px 26px;
    border: 1px dashed var(--service-theme-accent);
    border-radius: 22px;
    background: rgba(234, 220, 207, 0.42);
    color: var(--service-theme-text);
    line-height: 1.9;
  }
  .case-notice__box strong {
    color: var(--service-theme-accent-strong);
  }
  .case-filter {
    padding: 0 0 46px;
  }
  .case-filter__list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    list-style: none;
    margin: 0;
    padding: 0;
  }
  .case-filter__list a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 18px;
    border-radius: 999px;
    border: 1px solid var(--service-theme-border);
    background: rgba(255,255,255,0.72);
    color: var(--service-theme-text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 700;
  }
  .case-filter__list a.is-current {
    background: var(--service-theme-heading);
    border-color: var(--service-theme-heading);
    color: #fff;
  }
  .case-grid-section {
    padding: 0 0 120px;
  }
  .case-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
  }
  .case-card {
    overflow: hidden;
    border-radius: 30px;
    background: var(--service-theme-surface);
    border: 1px solid var(--service-theme-border);
    box-shadow: 0 18px 46px var(--service-theme-shadow);
  }
  .case-card__image {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--service-theme-surface-alt);
  }
  .case-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s ease;
  }
  .case-card:hover .case-card__image img { transform: scale(1.04); }
  .case-card__sample {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 2;
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(43, 35, 32, 0.82);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
  }
  .case-card__body {
    padding: 24px 24px 26px;
  }
  .case-card__meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
  }
  .case-card__season {
    display: inline-flex;
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--service-theme-accent-soft);
    color: var(--service-theme-accent-strong);
    font-size: 0.74rem;
    font-weight: 700;
  }
  .case-card__type {
    color: var(--service-theme-text);
    font-size: 0.8rem;
    font-weight: 700;
  }
  .case-card__title {
    margin: 0 0 12px;
    font-family: var(--theme-font-heading);
    font-size: 1.35rem;
    line-height: 1.5;
  }
  .case-card__text {
    margin: 0;
    color: var(--service-theme-text);
    font-size: 0.94rem;
    line-height: 1.9;
  }
  .case-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
  }
  .case-card__tags span {
    display: inline-flex;
    padding: 6px 9px;
    border-radius: 8px;
    background: var(--service-theme-bg-alt);
    color: var(--service-theme-text);
    font-size: 0.74rem;
    font-weight: 700;
  }
  .case-message {
    margin-top: 50px;
    padding: 42px;
    color: #62675d  ;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 28px;
    align-items: center;
  }
  .case-message__label {
    margin: 0 0 10px;
    color: rgba(255,255,255,0.7);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
  }
  .case-message h2 {
    margin: 0;
    font-family: var(--theme-font-heading);
    font-size: clamp(1.6rem, 3vw, 2.6rem);
    line-height: 1.35;
  }
  .case-message p {
    margin: 14px 0 0;
    color: #62675d;
    line-height: 1.9;
  }
  .case-message__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 180px;
    min-height: 52px;
    padding: 14px 24px;
    border-radius: 999px;
    background: #4f5b49  ;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
  }
  
  @media (max-width: 980px) {
    .preview-header__nav { display: none; }
    .gallery-intro__box { grid-template-columns: 1fr; gap: 24px; padding: 34px 0; }

    .case-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .case-message { grid-template-columns: 1fr; }

    .gallery-mosaic > .inner {
      width: min(calc(100% - 40px), 1380px);
    }
    
    .gallery-mosaic__grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      grid-auto-rows: 170px;
    }
    
  }
  
  @media (max-width: 767px) {
    :root { --header-height: 72px; }
    .inner { width: min(calc(100% - 28px), var(--container)); }

    .works-lead {
      min-height: 320px;
    }
  
    .works-lead__inner {
      padding-top: calc(var(--header-height, 72px) + 28px);
    }
    .works-lead__content {
      padding: 24px 0;
    }
    .works-lead__title {
      font-size: clamp(2.15rem, 11vw, 3.2rem);
    }
  
    .works-lead__text {
      font-size: 0.94rem;
      line-height: 1.9;
    }

    .gallery-mosaic {
      padding: 10px 0 78px;
    }
    
    .gallery-mosaic > .inner {
      width: min(calc(100% - 28px), 1380px);
    }
    
    .gallery-mosaic__grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      grid-auto-rows: 118px;
      gap: 10px;
    }
    
    .gallery-photo {
      border-radius: 14px;
    }
    
    .gallery-photo,
    .gallery-photo:nth-child(n) {
      grid-column: span 1;
      grid-row: span 1;
    }
  
    .gallery-photo:nth-child(5n + 1),
    .gallery-photo:nth-child(5n + 4) {
      grid-column: span 2;
      grid-row: span 2;
    }

    .gallery-photo__caption {
      left: 12px;
      bottom: 10px;
      font-size: 0.62rem;
    }

    .gallery-cta { flex-direction: column; align-items: flex-start; padding: 26px; }
    .case-filter__list { gap: 8px; }
    .case-filter__list a { min-height: 38px; padding: 8px 13px; font-size: 0.82rem; }
    .case-grid { grid-template-columns: 1fr; gap: 20px; }
    .case-grid-section { padding-bottom: 78px; }
    .case-message { padding: 30px 24px; }
  }
  
  .case-grid {
    transition:
      opacity 0.32s ease,
      transform 0.32s ease,
      filter 0.32s ease;
  }
  
  .case-grid.is-filtering {
    opacity: 0;
    transform: translateY(10px);
    filter: blur(1.5px);
  }
  
  .case-card {
    transition:
      opacity 0.45s ease,
      transform 0.45s ease;
  }
  
  .case-card.is-removed {
    display: none;
  }
  
  .case-card.is-fade-in {
    animation: caseCardFadeIn 0.55s ease both;
  }
  
  @keyframes caseCardFadeIn {
    from {
      opacity: 0;
      transform: translateY(18px);
    }
  
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  .case-empty-message {
    margin-top: 40px;
    padding: 32px 24px;
    border: 1px solid rgba(20, 45, 38, 0.12);
    border-radius: 20px;
    background: #fff;
    color: #4b5a55;
    text-align: center;
    font-size: 15px;
    line-height: 1.8;
  }
  
  .gallery-photo {
    position: relative;
  }
  
  .gallery-photo__sample {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 2;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(20, 45, 38, 0.72);
    color: #fff;
    font-size: 11px;
    letter-spacing: 0.12em;
    line-height: 1;
  }