@import url("page-common.css");

body.works-page {
  position: relative;
  isolation: isolate;
}

body.works-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: url("../img/works.jpeg") center / cover no-repeat;
  opacity: 1;
  pointer-events: none;
}

.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.filter-button {
  border: 1px solid transparent;
  cursor: pointer;
  color: #34435f;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.filter-button[data-filter="local"] {
  background: #dff3ff;
  border-color: #8fc8ea;
}

.filter-button[data-filter="facility"] {
  background: #ffe9d6;
  border-color: #e9b98d;
}

.filter-button[data-filter="companies"] {
  background: #ede3ff;
  border-color: #b9a4e8;
}

.filter-button[data-filter="self-hosted"] {
  background: #dff8e8;
  border-color: #9bcfae;
}

.filter-button.is-active[data-filter="local"] {
  background: #9bd8f5;
  border-color: #66b5da;
  color: #17344a;
}

.filter-button.is-active[data-filter="facility"] {
  background: #f8cda8;
  border-color: #deab7d;
  color: #4a2f1a;
}

.filter-button.is-active[data-filter="companies"] {
  background: #cdb7f7;
  border-color: #af93e2;
  color: #2c2145;
}

.filter-button.is-active[data-filter="self-hosted"] {
  background: #a9e8bf;
  border-color: #84cda0;
  color: #1f4230;
}

.filter-button:not(.is-active) {
  opacity: 0.88;
}

.filter-button.is-active {
  opacity: 1;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(22, 34, 66, 0.22), 0 0 0 2px rgba(255, 255, 255, 0.78);
}

.work-card.is-hidden {
  display: none;
}

.works-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.work-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
}

.work-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.work-card-media {
  position: relative;
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.work-card-category-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: #c7d6ef;
  color: #fff;
  font-size: 12px;
  line-height: 1;
  font-weight: 700;
  pointer-events: none;
}

.work-card-category-badge[data-category="local"] {
  background: #8ecce9;
  color: #17344a;
}

.work-card-category-badge[data-category="facility"] {
  background: #f3c49d;
  color: #4a2f1a;
}

.work-card-category-badge[data-category="companies"] {
  background: #c8b0f3;
  color: #2c2145;
}

.work-card-category-badge[data-category="self-hosted"] {
  background: #9fddb5;
  color: #1f4230;
}

.work-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.work-card h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.4;
}

.work-card p {
  margin: auto 0 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.work-card-detail {
  display: none;
}

.work-card-detail p{
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.indent{
  padding-left: 10px;
}

.work-card-gallery {
  display: none;
}

.work-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
}

.work-modal.is-open {
  display: block;
}

.work-modal-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(123, 199, 255, 0.22), transparent 42%),
    radial-gradient(circle at 85% 80%, rgba(33, 87, 214, 0.26), transparent 40%),
    linear-gradient(145deg, rgba(6, 12, 28, 0.78), rgba(10, 22, 48, 0.7));
}

.work-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(820px, calc(100% - 32px));
  max-height: calc(100vh - 40px);
  margin: 20px auto;
  overflow: auto;
  background: linear-gradient(to bottom right, #007bbb 0%, #dcdddd 72%, #dcdddd 100%);
  border-radius: 16px;
  border: none;
  box-shadow: 0 24px 60px rgba(6, 12, 28, 0.25);
  padding: 18px 18px 22px;
  scrollbar-width: thin;
  scrollbar-color: #007bbb rgba(255, 255, 255, 0.15);
}

.work-modal-dialog::-webkit-scrollbar {
  width: 10px;
}

.work-modal-dialog::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.15);
}

.work-modal-dialog::-webkit-scrollbar-thumb {
  background: linear-gradient(to bottom right, #007bbb 0%, #dcdddd 72%, #dcdddd 100%);
  border-radius: 999px;
}

.work-modal-close {
  position: sticky;
  top: 0;
  margin-left: auto;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-strong);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 20px;
  line-height: 1;
}

.work-modal-media {
  margin: 8px 0 14px;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.work-modal-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.work-modal-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
  margin: 0 0 14px;
}

.work-modal-gallery.is-hidden {
  display: none;
}

.work-modal-thumb {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  line-height: 0;
}

.work-modal-thumb.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(33, 87, 214, 0.15);
}

.work-modal-thumb img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.work-modal-dialog h3 {
  margin: 0 0 10px;
  font-size: 24px;
  line-height: 1.35;
}

.work-modal-body {
  background: transparent;
  border-radius: 0;
  padding: 0;
}

.work-modal-body p {
  margin: 0 0 4px;
  line-height: 1.8;
  color: var(--ink);
}

.work-modal-body h4 {
  margin: 14px 0 6px;
  font-size: 16px;
}

.work-modal-body ul {
  margin: 0 0 10px 20px;
  padding: 0;
}

body.modal-open {
  overflow: hidden;
}
main {
  padding: 48px 0 96px;
}

.page-hero {
  position: relative;
  padding: 24px 0 20px;
  overflow: hidden;
}

.page-hero::after {
  content: none;
  position: absolute;
  inset: auto 0 0 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(33, 87, 214, 0.2), transparent);
}

.page-hero-inner {
  display: grid;
  gap: 16px;
  padding: 32px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgb(237, 241, 252), rgb(229, 244, 255));
  border: 1px solid rgb(228, 235, 250);
}

.page-title-en {
  font-family: "Barlow Condensed", sans-serif;
  font-size: clamp(36px, 5vw, 54px);
  letter-spacing: 2px;
  margin: 0;
  color: var(--ink-strong);
  text-transform: uppercase;
}

.page-title-jp {
  font-size: 15px;
  color: var(--muted);
  margin: 0;
}

.breadcrumb {
  display: flex;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
}

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

.section {
  margin-bottom: 72px;
  opacity: 0;
  transform: translateY(12px);
  animation: fadeUp 0.7s ease forwards;
}

.section:nth-of-type(2) {
  animation-delay: 0.08s;
}

.section:nth-of-type(3) {
  animation-delay: 0.14s;
}

.section:nth-of-type(4) {
  animation-delay: 0.2s;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 12px;
  color: var(--accent);
  margin: 0 0 12px;
  font-family: "Barlow Condensed", sans-serif;
}

.section-title {
  font-family: "Barlow Condensed", sans-serif;
  font-size: clamp(28px, 3.2vw, 40px);
  margin: 0 0 12px;
  color: var(--ink-strong);
  letter-spacing: 1px;
}

.section-lead {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.grid {
  display: grid;
  gap: 20px;
}

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: none;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 22px;
  border-radius: 12px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  line-height: 1;
  font-size: 14px;
}

.button.secondary {
  background: transparent;
  color: var(--accent);
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 900px) {
  main {
    padding-top: 32px;
  }
}

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

@media (max-width: 640px) {
  .filters {
    gap: 8px;
    margin-bottom: 14px;
  }

  .filter-button.tag {
    font-size: 11px;
    padding: 5px 10px;
  }

  .works-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .work-card {
    gap: 6px;
  }

  .work-card h3 {
    font-size: 16px;
    line-height: 1.35;
  }

  .work-card p {
    font-size: 11px;
    line-height: 1.55;
  }

  .card.work-card {
    border-radius: 14px;
    padding: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .section {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

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

