@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+JP:wght@300;400&family=Noto+Sans+JP:wght@300;400;500&display=swap');

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

body {
  background-color: #f5f4ef;
  color: #3a3a36;
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 300;
  min-height: 100vh;
}

/* ==================
   Header
================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #f5f4ef;
  border-bottom: 0.5px solid #d8d5cc;
  padding: 0 40px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 100;
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.logo {
width: 100%;
max-width: 100px;
}

.back-link {
  font-size: 12px;
  color: #8a8880;
  text-decoration: none;
  letter-spacing: 0.05em;
  transition: color 0.2s;
}

.back-link::before {
  content: '← ';
}

.back-link:hover {
  color: #3a3a36;
}

/* ==================
   Main Layout
================== */
main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 140px 24px 120px;
}

/* ==================
   Page Head
================== */
.page-head {
  text-align: center;
  margin-bottom: 64px;
}

.page-label {
  font-size: 10px;
  letter-spacing: 0.2em;
  color: #3d6b56;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.page-title {
  font-family: 'Noto Serif JP', serif;
  font-size: 30px;
  font-weight: 300;
  color: #2e2e2a;
  margin-bottom: 16px;
  line-height: 1.5;
}

.page-desc {
  font-size: 13px;
  font-family: 'noto serif jp', serif;
  color: #7a7870;
  line-height: 2;
}

/* ==================
   Filter
================== */
.filter-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 56px;
}

.filter-btn {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: #8a8880;
  background: none;
  border: 0.5px solid #d0cec6;
  border-radius: 2px;
  padding: 8px 20px;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn.active,
.filter-btn:hover {
  background: #3d6b56;
  color: #fff;
  border-color: #3d6b56;
}

/* ==================
   Works Grid
================== */
.works-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px 32px;
}

@media (max-width: 860px) {
  .works-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px 20px;
  }
}

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

/* ==================
   Work Card
================== */
.work-card {
  cursor: pointer;
}

.work-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  margin-bottom: 16px;
  position: relative;
  background: #e0ddd6;
}

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

.work-card:hover .work-img img {
  transform: scale(1.03);
}

.work-img-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #d8d5cc;
  opacity: 0.6;
}

.work-hover-overlay {
  position: absolute;
  inset: 0;
  background: rgba(61, 107, 86, 0);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s;
}

.work-card:hover .work-hover-overlay {
  background: rgba(61, 107, 86, 0.18);
}

.preview-icon {
  opacity: 0;
  transition: opacity 0.3s;
  background: #fff;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.work-card:hover .preview-icon {
  opacity: 1;
}

.work-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  font-size: 10px;
  letter-spacing: 0.1em;
  background: #3d6b56;
  color: #fff;
  padding: 4px 10px;
  border-radius: 1px;
}

.work-title {
  font-family: 'Noto Serif JP', serif;
  font-size: 15px;
  font-weight: 300;
  color: #2e2e2a;
  margin-bottom: 8px;
  line-height: 1.6;
}

.work-desc {
  font-size: 12px;
  color: #8a8880;
  line-height: 1.9;
}

.work-more {
  font-size: 11px;
  color: #3d6b56;
  letter-spacing: 0.08em;
  margin-top: 10px;
  display: inline-block;
}

/* ==================
   Divider
================== */
.divider {
  height: 0.5px;
  background: #e2e0d8;
  margin: 72px 0 56px;
}

/* ==================
   CTA Section
================== */
.cta-section {
  text-align: center;
}

.cta-title {
  font-family: 'Noto Serif JP', serif;
  font-size: 22px;
  font-weight: 300;
  color: #2e2e2a;
  margin-bottom: 12px;
}

.cta-desc {
  font-size: 13px;
  color: #7a7870;
  line-height: 2;
  margin-bottom: 32px;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 16px 48px;
  background: #3d6b56;
  color: #fff;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 13px;
  letter-spacing: 0.1em;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
}

.cta-btn:hover {
  background: #2e5040;
}

/* ==================
   Modal
================== */
.modal-wrap {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 18, 0.88);
  z-index: 200;
  overflow-y: auto;
  padding: 40px 24px;
}

.modal-wrap.open {
  display: block;
}

.modal-inner {
  background: #f5f4ef;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  border-radius: 4px;
  overflow: hidden;
  animation: modalIn 0.3s ease;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 0.5px solid #d8d5cc;
}

.modal-header-title {
  font-family: 'Noto Serif JP', serif;
  font-size: 14px;
  font-weight: 300;
  color: #2e2e2a;
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: #8a8880;
  font-size: 20px;
  line-height: 1;
  padding: 4px 8px;
  transition: color 0.2s;
}

.modal-close:hover {
  color: #2e2e2a;
}

.modal-img-area {
  width: 100%;
  background: #e0ddd6;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 32px 0;
  max-height: 60vh;
  overflow-y: auto;
}

.modal-img-scroll {
  width: 80%;
}

.modal-img-scroll img {
  width: 100%;
  display: block;
}

.modal-img-fallback {
  width: 80%;
  min-height: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: #aaa89f;
  font-size: 12px;
  letter-spacing: 0.05em;
}

.modal-body {
  padding: 28px 24px;
}

.modal-tag {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.1em;
  background: #e8f2ed;
  color: #3d6b56;
  padding: 4px 12px;
  border-radius: 1px;
  margin-bottom: 14px;
}

.modal-body-title {
  font-family: 'Noto Serif JP', serif;
  font-size: 18px;
  font-weight: 300;
  color: #2e2e2a;
  margin-bottom: 10px;
}

.modal-body-desc {
  font-size: 13px;
  color: #7a7870;
  line-height: 1.9;
  margin-bottom: 24px;
}

.modal-nav {
  display: flex;
  gap: 12px;
}

.modal-btn {
  flex: 1;
  padding: 13px;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.08em;
  border-radius: 2px;
  cursor: pointer;
  font-family: 'Noto Sans JP', sans-serif;
  transition: all 0.2s;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-btn-primary {
  background: #3d6b56;
  color: #fff;
  border: none;
}

.modal-btn-primary:hover {
  background: #2e5040;
}

.modal-btn-secondary {
  background: none;
  border: 0.5px solid #d0cec6;
  color: #8a8880;
}

.modal-btn-secondary:hover {
  border-color: #8a8880;
  color: #5a5850;
}
