*, *::before, *::after { box-sizing: border-box; }
body, html {
  margin: 0;
  padding: 0;
  background: #fff;
  width: 100%;
  font-family: 'Noto Serif JP', serif;
  scroll-behavior: smooth;
}

/* ===== HEADER ===== */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 72px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
  border-bottom: 1px solid #e0e0e0;
}

.header-logo {
  display: flex;
  align-items: center;
}

.header-logo img {
  height: 40px;
}

nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

nav a {
  text-decoration: none;
  color: #595757;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  position: relative;
  padding-bottom: 3px;
}
nav a:not(.nav-contact):not([alria-label])::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: #595757;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}
nav a:not(.nav-contact):not([aria-label]):hover::after {
  transform: scaleX(1);
}
nav a:not(.nav-contact):not([aria-label]):hover { color: #000; }

.nav-contact {
  background: #111;
  color: #fff !important;
  padding: 8px 18px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: opacity 0.2s !important;
}
.nav-contact:hover { opacity: 0.7; }

.nav-icons {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-left: 4px;
}
.nav-icons a {
  color: #595757;
  font-size: 1rem;
  display: flex;
  align-items: center;
}

/* ===== WORKS CONTENT ===== */
.works-page {
  width: 100%;
  padding: 112px 40px 80px;
  box-sizing: border-box;
}

.works-page-heading {
  max-width: 1200px;
  margin: 0 auto 40px;
}

.works-page-heading img {
  max-width: 200px;
  height: auto;
}

.works-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  max-width: 1200px;
  margin: 0 auto;
}

/* ===== カード フェードインアニメーション ===== */
.works-card {
  position: relative;
  overflow: hidden;
  background: #ccc;
  aspect-ratio: 1 / 1;
  cursor: pointer;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1.4s ease, transform 1.4s ease;
}
.works-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.works-card.is-pressed {
  transform: scale(0.97);
}

.works-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.works-card.is-hover .works-card-img {
  transform: scale(1.04);
}

.works-card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  transition: background 0.3s ease;
}

.works-card.is-hover .works-card-overlay {
  background: rgba(0, 0, 0, 0.7);
}

.works-card-view {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.works-card.is-hover .works-card-view {
  opacity: 1;
}

.works-card-view span {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.8);
  padding: 8px 20px;
  text-transform: uppercase;
}

.works-card-info {
  position: absolute;
  top: 50%;
  left: 20px;
  transform: translateY(-50%);
  color: #fff;
}

.works-card-title {
  display: block;
  height: 18px;
  width: auto;
}

/* ===== MODAL ===== */
#works-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

#works-modal.open {
  display: flex;
}

#works-modal-inner {
  background: #fff;
  padding: 40px 32px 32px;
  max-width: 560px;
  width: 90%;
  position: relative;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#works-modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: #333;
  line-height: 1;
}

#works-modal-title {
  height: 28px;
  width: auto;
  margin: 0 0 10px;
  flex-shrink: 0;
  align-self: flex-start;
}

#works-modal-images {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#works-modal-main {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#works-modal-main img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}


#works-modal-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
  flex-shrink: 0;
}

.modal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ccc;
  cursor: pointer;
  transition: background 0.3s;
}

.modal-dot.active {
  background: #333;
}

#works-modal-thumbs {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-shrink: 0;
}

#works-modal-thumbs img {
  width: calc((100% - 12px) / 3);
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 4px;
  opacity: 0.7;
  cursor: pointer;
  transition: opacity 0.3s;
}

#works-modal-thumbs img:hover {
  opacity: 1;
}


/* タブレット以下：+アイコン表示、VIEW非表示 */
@media (max-width: 1024px) {
  .works-card-view {
    display: none;
  }
  .works-card::after {
    content: '+';
    position: absolute;
    bottom: 8px;
    right: 10px;
    color: rgba(255,255,255,0.85);
    font-size: 1.3rem;
    font-weight: 300;
    line-height: 1;
    pointer-events: none;
  }
}

@media (min-width: 1025px) {
  #works-modal-inner {
    max-width: 760px;
  }
}

@media (max-width: 480px) {
  #works-modal-inner {
    padding: 40px 16px 16px;
  }
}


/* ===== FOOTER ===== */
.site-footer {
  width: 100%;
  padding: 60px 40px 0;
  box-sizing: border-box;
}

.footer-inner {
  display: flex;
  gap: 40px;
  align-items: flex-start;
  margin: 0 auto;
  justify-content: center;
  border-bottom: 1px solid #e0e0e0;
  max-width: 750px;
  padding: 30px;
}

.footer-map {
  flex-shrink: 0;
  width: 280px;
  height: 180px;
}

.footer-map iframe {
  width: 100%;
  height: 100%;
  display: block;
  filter: grayscale(40%) saturate(80%);
}

.footer-mail {
  color: #555;
  text-decoration: none;
  border-bottom: 1px solid #aaa;
  transition: color 0.2s, border-color 0.2s;
}

.footer-mail:hover {
  color: #111;
  border-color: #111;
}

.footer-info {
  flex: none;
  width: fit-content;
}

.footer-company {
  font-size: 1rem;
  font-weight: 500;
  color: #595757;
  margin: 0 0 16px;
  line-height: 1.2;
}

.footer-company span {
  font-size: 0.85rem;
  font-weight: 400;
}

.footer-address {
  font-size: 0.85rem;
  color: #595757;
  line-height: 1.6;
  margin: 0;
}

.footer-nav-wrap {
  padding: 20px 0;
}

.footer-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
}

.footer-nav a {
  text-decoration: none;
  color: #595757;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.footer-contact {
  background: #111;
  color: #fff !important;
  padding: 8px 18px;
  border-radius: 4px;
}

.footer-instagram {
  display: flex;
  align-items: center;
  color: #595757;
}

.footer-copy {
  text-align: center;
  padding: 24px 0;
}

.footer-copy p {
  font-size: 0.75rem;
  color: #999;
  margin: 0;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .works-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  header nav a:not(.nav-contact):not([aria-label]) {
    display: none;
  }
  .works-page {
    padding: 96px 20px 60px;
  }
  .footer-inner {
    gap: 20px;
    padding: 20px;
  }
  .footer-map {
    width: 200px;
    height: 160px;
    flex-shrink: 0;
  }
  .footer-info {
    min-width: 0;
  }
  .footer-address {
    font-size: 0.78rem;
    word-break: break-word;
  }
  .footer-company {
    font-size: 0.9rem;
  }
}

@media (max-width: 600px) {
  .works-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}

@media (max-width: 480px) {
  header {
    padding: 0 12px;
    gap: 8px;
  }
  .header-logo img {
    height: 28px;
  }
  nav {
    gap: 10px;
  }
  .nav-contact {
    padding: 6px 10px;
    font-size: 0.62rem;
  }
  .works-page-heading img {
    max-width: 60%;
  }
  .site-footer {
    padding: 40px 20px 0;
  }
  .footer-inner {
    flex-direction: column;
    align-items: center;
  }
  .footer-map {
    width: 100%;
    height: 200px;
  }
  .footer-nav {
    flex-wrap: wrap;
    gap: 16px;
  }
}