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

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/Inter-Variable.woff2') format('woff2');
}

:root {
  --color-white: #fff;
  --color-black: #000;
  --color-bg-outer: #ddd;
  --color-bg-content: #e8e8e8;
  --color-bg-home-placeholder: #eee;
  --color-placeholder: #ccc;
  --color-surface-muted: #ececec;
  --color-text-muted: #616161;
  --color-text-tooltip: #555;
  --color-bar-bg: #ddd;
  --color-lightbox-bg: #707070;
  --color-status-available: #7ab180;
  --color-status-sold: #a4a4a4;
  --color-status-reserved: #d29842;
  --color-hairline: rgba(0, 0, 0, 0.10);
  --color-divider: rgba(0, 0, 0, 0.2);
  --color-overlay: rgba(0, 0, 0, 0.5);
  --color-tap-highlight: rgba(255, 255, 255, 0.5);
  --color-dot: #ccc;
  --color-dot-active: #b6b6b6;

  --site-width-max: 1300px;
  --site-width-min: 500px;
  --grid-padding: 30px;
  
  --main-padding: clamp(2rem, calc(2.0rem + (100vw - var(--site-width-min)) / (var(--site-width-max) - var(--site-width-min)) * 8.0rem), 10rem);
  --site-left-margin: max(0rem, calc((100vw - var(--site-width-max)) / 2));
  --grid-padding-adaptive: var(--grid-padding);
}

body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  font-weight: 350;
  line-height: 1.4;
  background: var(--color-bg-outer);
  color: var(--color-black);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: var(--color-tap-highlight);
  display: flex;
  flex-direction: column;
}

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

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

#bg {
  background-color: var(--color-bg-home-placeholder);
}

#bg-next {
  opacity: 0;
  transition: opacity 0.8s ease;
}

#bg-next.is-visible {
  opacity: 1;
}

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

.identity {
  display: inline-block;
}

body.route-home .identity {
  background: var(--color-white);
  padding: 2rem;
  margin: -2rem;
}

header {
  position: relative;
  z-index: 1;
  max-width: 1300px;
  margin-left: var(--site-left-margin);
  margin-right: auto;
  width: 100%;
  padding-top: 2rem;
  padding-bottom: 0.6rem;
  padding-left: var(--main-padding);
  padding-right: var(--main-padding);
  background: var(--color-bg-content);
}

body.route-home header {
  background: transparent;
}

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

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

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

.identity h1 .sep {
  margin: 0 0 0 0.4em;
  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: 1.0rem;
  margin-top: 0.8rem;
}

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

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

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

main {
  position: relative;
  z-index: 1;
  padding-top: 1.2rem;
  padding-bottom: 4rem;
  max-width: 1300px;
  margin-left: var(--site-left-margin);
  margin-right: auto;
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--color-bg-content);
}

main > .page-banner:last-child {
  flex: 1;
  margin-bottom: 0;
}

main:has(> .page-banner:last-child) {
  padding-bottom: 0;
}

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

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

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: var(--main-padding);
}

.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;
  margin-left: var(--grid-padding-adaptive);
  margin-right: var(--grid-padding-adaptive);
}

.project-card {
  display: block;
  background: var(--color-surface-muted);
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
}

.project-card__top {
  padding: 1rem 1.25rem;
  background: var(--color-white);
}

.project-card__top h2 {
  font-size: 1.3rem;
  font-weight: bold;
  margin-bottom: 0.35rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-card__top .meta {
  font-size: 0.85rem;
  font-weight:350
}

.project-card__image {
  width: 100%;
  aspect-ratio: 4 / 5;
  background-color: var(--color-placeholder);
  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: var(--color-white);
  background: var(--color-overlay);
  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: var(--color-white);
  width: min(100vw, 1300px);
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  padding: 2.5rem 0;
  margin-bottom: 2.5rem;
}

.project-header:has(.project-header__gallery),
.project-header:has(.project-header__inner .project-header__item) {
  padding-bottom: 0;
  margin-bottom: 0;
}

.project-header__inner {
  padding-left: var(--main-padding);
  padding-right: var(--main-padding);
}

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

.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-wrap {
  position: relative;
  background: var(--color-bg-content);
}

.project-header__gallery {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  cursor: grab;
}

.project-header__gallery::-webkit-scrollbar {
  display: none;
}

.project-header__gallery.is-dragging {
  cursor: grabbing;
  user-select: none;
}

.gallery-nav {
  display: none;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--color-divider);
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.gallery-nav.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.gallery-nav--prev {
  left: 1.2rem;
}

.gallery-nav--next {
  right: 1.2rem;
}

.gallery-nav img {
  width: 14px;
  height: 14px;
  filter: brightness(0) invert(1);
}

.gallery-nav--prev img {
  transform: scaleX(-1);
}

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

.project-header__item:has(video) {
  width: 100%;
  max-width: 720px;
  margin-bottom: 120px;
}

.gallery-dots {
  position: relative;
  height: 4px;
  margin-top: 12px;
}

.gallery-dot {
  position: absolute;
  top: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-dot);
  transform: translateX(-50%);
  transition: background 0.15s ease;
}

.gallery-dot.is-active {
  background: var(--color-dot-active);
}

.jump-to-works {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  background: var(--color-bar-bg);
  color: var(--color-black);
  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: var(--color-bar-bg);
  color: var(--color-black);
  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__title {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 1.3rem;
  font-weight: 350;
  letter-spacing: 0.02em;
  margin-top: 4rem;
  margin-bottom: 2.0rem;
  margin-left: var(--grid-padding-adaptive);
  margin-right: var(--grid-padding-adaptive);
}

.works-grid__title::before,
.works-grid__title::after {
  content: '';
  flex: 1 1 auto;
  height: 1px;
  background: var(--color-divider);
}

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

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

.work-card__image {
  display: block;
  width: 100%;
  height: auto;
  background-color: var(--color-placeholder);
  margin-bottom: 0.5rem;
  outline: 1px solid var(--color-hairline);
}

.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: 350;
  color: var(--color-text-muted);
}

.work-card__status,
.work-detail__status {
  display: inline-block;
  padding: 0.35em 0.5em 0.3em;
  font-size: 0.55rem;
  font-weight: 350;
  text-transform: uppercase;
  color: var(--color-white);
  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: var(--color-text-tooltip);
  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: var(--color-status-available); }
.work-card__status--sold,
.work-detail__status--sold { background: var(--color-status-sold); }
.work-card__status--reserved,
.work-detail__status--reserved { background: var(--color-status-reserved); }

.work-detail {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding-left: var(--main-padding);
  padding-right: var(--main-padding);
}

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

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

.work-detail__images img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 11rem);
  background: var(--color-placeholder);
  margin: 0 auto;
  outline: 1px solid var(--color-hairline);
}

.work-image-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--color-placeholder);
}

.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: none;
  outline: 1px solid var(--color-hairline);
  background: var(--color-surface-muted);
  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: var(--color-overlay);
}

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

#lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--color-lightbox-bg);
  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;
}

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

.about-page {
  max-width: 960px;
}

.about-page__intro,
.about-page__section {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.about-page__section {
  margin-top: 2.5rem;
}

.about-page__text {
  flex: 1 1 auto;
  min-width: 0;
}

.about-page__text h2 {
  margin-top: 0;
}

.about-page__photo {
  width: 156px;
  flex-shrink: 0;
  display: block;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  margin-top: 2.0rem;
}

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

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

.available-intro p:has(+ ul) {
  margin-bottom: 1.5rem;
}

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

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

.page-banner {
  background: var(--color-white);
  width: min(100vw, 1300px);
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  padding: 2.5rem 0;
  margin-bottom: 2.5rem;
}


.page-banner__inner {
  padding-left: var(--main-padding);
  padding-right: var(--main-padding);
}

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

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

.available-card__image {
  display: block;
  width: 100%;
  height: auto;
  background-color: var(--color-placeholder);
  margin-bottom: 0.5rem;
  outline: 1px solid var(--color-hairline);
}

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

.available-card h3 {
  font-size: 0.8rem;
  font-weight: 350;
  color: var(--color-text-muted);
}

.available-card__meta {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 0.15rem;
}

.available-card__price {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  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;
  }

  
  .about-page__intro,
  .about-page__section {
    flex-direction: column;
    gap: 0rem;
  }

  .about-page__photo {
    order: -1;
    width: 100%;
    max-width: 224px;
  }

  .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: var(--color-white);
    padding-bottom: 1.65rem;
  }

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


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

  .project-card__bottom {
    display: none;
  }

  .gallery-nav {
    display: none;
  }

  .project-header__item {
    height: 360px;
    width: calc(360px * var(--ar, 1));
  }

  .project-header__item:has(video) {
    width: 100vw;
    max-width: none;
    height: auto;
    aspect-ratio: var(--ar, 1);
    margin-left: calc(-1 * var(--main-padding));
    margin-right: calc(-1 * var(--main-padding));
  }
  #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);
  }
}
