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

:root {
  --col-edge: max(0rem, calc((100vw - 1200px) / 2));
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  background: #d9d9d9;
  color: #000;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: rgba(255, 255, 255, 0.5);
}

body.route-home {
  height: 100vh;
  overflow: hidden;
}

#bg {
  position: fixed;
  inset: 0;
  top: var(--bg-top, 0);
  background-color: #d9d9d9;
  background-size: cover;
  background-position: center;
  z-index: 0;
  display: none;
}

body.route-home #bg {
  display: block;
}

body.route-home .identity {
  background: #d9d9d9;
  padding: 2rem 2.0rem 1.5rem;
  margin: -2rem -2.0rem -1.5rem;
}

header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 2rem 1.25rem 2.2rem calc(var(--col-edge) + 5rem);
  pointer-events: none;
}

header > * {
  pointer-events: auto;
}

.identity {
  transition: opacity 0.15s ease;
}

body.scrolled .identity {
  opacity: 0;
  pointer-events: none;
}

.identity h1 {
  font-size: 1.3rem;
  font-weight: normal;
  letter-spacing: 0.02em;
  line-height: 1;
}

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

.identity h1 a:hover {
  text-decoration: underline;
}

.identity h1 .sep {
  margin: 0 0.4em 0 0;
  opacity: 0.6;
}

.crumb-group {
  display: inline-block;
  white-space: nowrap;
  vertical-align: bottom;
}

#home-name {
  cursor: pointer;
  user-select: none;
  display: inline-block;
  white-space: nowrap;
  width: 152px;
}

.identity p {
  font-size: 0.85rem;
  margin-top: 0.35rem;
  opacity: 0.85;
  display: none !important;
}

#home-nav {
  display: none;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.75rem;
}

body.route-home #home-nav {
  display: flex;
}

#home-nav a {
  font-size: 1.3rem;
  font-weight: normal;
  letter-spacing: 0.02em;
  color: inherit;
  text-decoration: none;
}

#home-nav a:hover {
  text-decoration: underline;
}

#menu-btn {
  background: #fff;
  border: none;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: none !important;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  padding: 7px;
}

#nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 20;
}

#nav-overlay.open {
  display: block;
}

#nav-backdrop {
  position: absolute;
  inset: 0;
}

#nav-menu {
  position: absolute;
  top: 2rem; right: 1.25rem;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.10);
  padding: 1.5rem 3.5rem 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.7rem;
  min-width: 240px;
}

#nav-close {
  position: absolute;
  top: 0; right: 0;
  background: none;
  border: none;
  cursor: pointer;
  padding: 7px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#nav-menu a {
  color: #000;
  text-decoration: none;
  font-size: 1.3rem;
  font-family: system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  font-weight: normal;
}

#nav-menu a:hover {
  text-decoration: underline;
}

main {
  position: relative;
  z-index: 1;
  padding: var(--header-h, 5.3rem) 2rem 4rem;
  max-width: 1200px;
  margin-left: var(--col-edge);
  margin-right: auto;
}

body.route-home main {
  display: none;
}

body.route-projects main {
  padding-top: 4rem;
}

body.route-work main {
  padding-bottom: 2rem;
}

body.route-work .work-detail__images img {
  max-height: calc(100vh - 9rem);
}

.page-title {
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 2rem;
}

.projects-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 2rem;
  margin-left: 3rem;
}

.projects-filter__btn {
  color: inherit;
  text-decoration: none;
  font-size: 1rem;
  display: inline-block;
  padding: 0.5rem 0;
}

.projects-filter__btn::before {
  content: attr(data-label);
  display: block;
  height: 0;
  visibility: hidden;
  overflow: hidden;
  font-weight: bold;
}

.projects-filter__btn:hover {
  text-decoration: underline;
}

.projects-filter__btn.is-active {
  font-weight: bold;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  gap: 1.5rem;
}

.project-card {
  display: block;
  background: #ececec;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.10);
}

.project-card__top {
  padding: 1rem 1.25rem;
  background: #fff;
}

.project-card__top h2 {
  font-size: 1.3rem;
  font-weight: bold;
  margin-bottom: 0.35rem;
}

.project-card__top .meta {
  font-size: 0.85rem;
  opacity: 0.75;
}

.project-card__image {
  width: 100%;
  aspect-ratio: 4 / 5;
  background-color: #ccc;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.project-card__bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0;
  padding: 0 1.25rem;
  font-size: 0.9rem;
  color: #fff;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow: hidden;
  transition: height 0.2s ease, padding 0.2s ease;
}

.project-card:hover .project-card__bottom {
  height: 2.7rem;
  padding: 0.85rem 1.25rem;
}

.project-card__bottom span,
.project-card__bottom img {
  opacity: 0;
  transition: opacity 0.15s ease;
}

.project-card:hover .project-card__bottom span,
.project-card:hover .project-card__bottom img {
  opacity: 1;
}

.project-card__bottom img {
  width: 0.55em;
  height: 0.55em;
  filter: brightness(0) invert(1);
  flex-shrink: 0;
  position: relative;
  top: 0.14em;
}

.project-header {
  background: #fff;
  width: 100vw;
  position: relative;
  left: calc(-50vw + 50%);
  padding: 2.5rem 0;
  margin-bottom: 2.5rem;
}

.project-header__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.project-header__text {
  max-width: 720px;
  margin-bottom: 3rem;
  margin-left: 3rem;
}

.project-header__text h1 {
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.project-header__text .meta {
  font-size: 0.9rem;
  opacity: 0.75;
  margin-bottom: 1.25rem;
}

.project-header__text p {
  line-height: 1.6;
}

.project-header__text p + p,
.project-header__text p + ul,
.project-header__text ul + p {
  margin-top: 1em;
}

.project-header__text ul,
.work-detail__text .description ul {
  list-style: disc;
  padding-left: 1.2em;
}

.project-header__links {
  margin-top: 1rem;
}

.project-header__links a {
  display: block;
  color: inherit;
  font-weight: bold;
  text-decoration: underline;
}

.project-header__links a + a {
  margin-top: 0.25rem;
}

.project-header__gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}

.project-header__item {
  height: 440px;
  width: calc(440px * var(--ar, 1));
  background-color: #ccc;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  flex-shrink: 0;
}

.jump-to-works {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  background: #d9d9d9;
  color: #000;
  text-align: center;
  padding: 0.6rem 0;
  cursor: pointer;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.jump-to-works.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.jump-to-works__arrow {
  width: 0.55em;
  height: 0.55em;
  margin: 0 0.2em;
  position: relative;
  top: 0em;
  transform: rotate(90deg);
}

.back-to-top {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 9;
  background: #d9d9d9;
  color: #000;
  text-align: center;
  padding: 0.6rem 0;
  cursor: pointer;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.back-to-top__arrow {
  width: 0.55em;
  height: 0.55em;
  margin: 0 0.2em;
  position: relative;
  top: 0em;
  transform: rotate(-90deg);
}

body.scrolling-up .back-to-top {
  opacity: 1;
  pointer-events: auto;
}

body.route-work .back-to-top {
  display: none;
}

.project-header__item video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
  gap: 2.25rem 1.5rem;
}

.work-card {
  display: block;
  text-decoration: none;
  color: inherit;
}

.work-card__image {
  display: block;
  width: 100%;
  height: auto;
  background-color: #ccc;
  margin-bottom: 0.5rem;
  border: 1px solid rgba(0, 0, 0, 0.10);
}

.work-card__image--empty {
  aspect-ratio: 4 / 5;
}

.work-card__footer {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.work-card h3 {
  font-size: 0.8rem;
  font-weight: normal;
  color: #616161;
}

.work-card__status,
.work-detail__status {
  display: inline-block;
  padding: 0.2em 0.5em 0.3em;
  font-size: 0.55rem;
  font-weight: normal;
  text-transform: uppercase;
  color: #fff;
  letter-spacing: 0.05em;
  white-space: nowrap;
  flex-shrink: 0;
}

.work-detail__status {
  margin-bottom: 1.5rem;
}

.work-detail__status-link {
  display: inline-block;
  color: inherit;
  text-decoration: none;
  margin-bottom: 1.5rem;
}

.work-detail__status-link .work-detail__status {
  margin-bottom: 0;
}

.work-detail__status-tooltip {
  margin-left: 0.5rem;
  color: #555;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  vertical-align: middle;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.work-detail__status-link:hover .work-detail__status-tooltip {
  opacity: 1;
}

.work-detail__status-tooltip-arrow {
  display: inline-block;
  width: 0.55em;
  height: 0.55em;
  margin-left: 0.4em;
  vertical-align: middle;
  background-color: currentColor;
  -webkit-mask: url('icons/arrow-right.svg') center / contain no-repeat;
  mask: url('icons/arrow-right.svg') center / contain no-repeat;
}

.work-card__status--available,
.work-detail__status--available { background: #7ab180; }
.work-card__status--sold,
.work-detail__status--sold { background: #a4a4a4; }
.work-card__status--reserved,
.work-detail__status--reserved { background: #d29842; }

.work-detail {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.work-detail__images {
  flex: 1 1 500px;
  min-width: 0;
}

.work-detail__text {
  flex: 0 1 420px;
  display: flex;
  flex-direction: column;
}

.work-detail__images img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 11rem);
  background: #ccc;
  margin: 0 auto;
  border: 1px solid rgba(0, 0, 0, 0.10);
}

.work-image-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #ccc;
}

.work-detail__text h2 {
  font-size: 1.8rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.work-detail__text .meta {
  font-size: 0.9rem;
  opacity: 0.75;
  margin-bottom: 1.5rem;
}

.work-detail__text .description {
  line-height: 1.6;
}

.work-detail__text .description p + p,
.work-detail__text .description p + ul,
.work-detail__text .description ul + p {
  margin-top: 1em;
}

.work-detail__thumbnails {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 2rem;
}

.work-detail__thumbnail {
  position: relative;
  padding: 0;
  border: 1px solid rgba(0, 0, 0, 0.10);
  background: #ececec;
  cursor: pointer;
  height: 95px;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.work-detail__thumbnail img {
  display: block;
  height: 100%;
  width: auto;
}

.work-detail__thumbnail.is-active {
  transform: translateY(-6px);
}

.work-detail__thumbnail.is-active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 1px;
  background: rgba(0, 0, 0, 0.5);
}

#work-main-image {
  cursor: zoom-in;
}

#lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #707070;
  cursor: zoom-out;
}

#lightbox.open {
  display: flex;
  align-items: center;
  justify-content: center;
}

#lightbox-image {
  max-width: calc(100vw - 2rem);
  max-height: calc(100vh - 2rem);
  display: block;
}

#lightbox-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: transparent;
  border: none;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 7px;
}

#lightbox-close:hover img {
  filter: brightness(0) invert(1);
}

body.lightbox-open {
  overflow: hidden;
}

.flat-page {
  max-width: 720px;
  line-height: 1.6;
  margin-left: 3rem;
}

.flat-page > :first-child {
  margin-top: 0;
}

.flat-page p {
  margin-bottom: 1rem;
}

.flat-page p:has(+ ul) {
  margin-bottom: 0.25rem;
}

.flat-page a {
  color: inherit;
  font-weight: bold;
  text-decoration: underline;
}

.flat-page ul {
  list-style: disc;
  padding-left: 1.2em;
}

.page-banner {
  background: #fff;
  width: 100vw;
  position: relative;
  left: calc(-50vw + 50%);
  padding: 2.5rem 0;
  margin-bottom: 2.5rem;
}

.page-banner__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.available-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
  gap: 2.25rem 1.5rem;
}

.available-card {
  display: block;
  text-decoration: none;
  color: inherit;
}

.available-card__image {
  display: block;
  width: 100%;
  height: auto;
  background-color: #ccc;
  margin-bottom: 0.5rem;
  border: 1px solid rgba(0, 0, 0, 0.10);
}

.available-card__image--empty {
  aspect-ratio: 4 / 5;
}

.available-card h3 {
  font-size: 0.8rem;
  font-weight: normal;
  color: #616161;
}

.available-card__meta {
  font-size: 0.75rem;
  color: #616161;
  margin-top: 0.15rem;
}

.available-card__price {
  font-size: 0.75rem;
  color: #616161;
  margin-top: 0.05rem;
}

.flat-page h2 {
  font-size: 1.3rem;
  font-weight: bold;
  margin-top: 2.5rem;
  margin-bottom: 0.5rem;
}

.flat-page h3 {
  font-size: 1.1rem;
  font-weight: bold;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

/* --- Mobile --- */

@media (max-width: 720px) {
  #lightbox-close {
    display: none;
  }

  header {
    padding-top: 1.5rem;
    padding-bottom: 1.8rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  main {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .projects-filter {
    margin-left: 0.0rem;
  }

  .projects-grid {
    margin-left: -0.65rem;
    margin-right: -0.65rem;
  }

  .project-header__inner {
    padding: 0 1.5rem;
  }
  .project-header__text {
    margin-left: 0;
  }

  .page-banner__inner {
    padding: 0 1.5rem;
  }
  .flat-page {
    margin-left: 0;
  }

  .identity {
    max-width: calc(100vw - 3rem);
  }
  .identity h1 {
    line-height: 1.5;
  }

  .project-header__text p,
  .work-detail__text .description,
  .flat-page{
    line-height: 1.8;
  }

  .flat-page p {
    margin-bottom: 1.5rem;
  }

  .project-header__text p + p,
  .project-header__text p + ul,
  .project-header__text ul + p,
  .work-detail__text .description p + p,
  .work-detail__text .description p + ul,
  .work-detail__text .description ul + p {
    margin-top: 1.5em;
  }
  .crumb-group {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body.route-home header {
    background: #d9d9d9;
    padding-bottom: 1.65rem;
  }

  .jump-to-works,
  .back-to-top {
    padding: 0.75rem 0;
  }

  main {
    padding-top: var(--header-h, 5rem);
  }

  body.route-projects main {
    padding-top: calc(var(--header-h, 5rem) - 1.5rem);
  }

  #home-nav {
    margin-top: 0.4rem;
  }

  body.route-home .identity {
    background: transparent;
    padding: 0;
    margin: 0;
    max-width: none;
  }

  .project-card__bottom {
    display: none;
  }

  .project-header__gallery {
    flex-direction: column;
    gap: 0;
    margin-left: -1.5rem;
    margin-right: -1.5rem;
  }
  .project-header__item {
    width: 100vw;
    height: auto;
    aspect-ratio: var(--ar, 1);
    transform: none !important;
  }
  #lightbox-image {
  max-width: calc(100vw);
  max-height: calc(100vh);
  }

  .work-detail__images {
    margin-bottom: 1.0rem;
  }

  .work-detail__thumbnails {
    order: -1;
    margin-top: 0;
    padding-top: 0;
    padding-bottom: 1rem;
  }

  .work-detail__thumbnail {
    height: calc(95px * 0.75);
  }
}
