* { box-sizing: border-box; }

html {
  margin: 0;
  padding: 0;
  background: #fff;
  overflow-x: hidden;
  overflow-y: auto;
}

body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  color: #000;
  background: #fff;
  font-family: "LINE Seed JP", "Hiragino Sans", "Yu Gothic", sans-serif;
  -webkit-user-select: none;
  user-select: none;
}

body.lock-scroll { overflow-y: hidden; }

::selection { color: #000; background: #ffd433; }

[hidden] { display: none !important; }

/* Nav */
.top-nav {
  position: relative;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 100px;
  padding: 30px 60px 0;
}

.nav-left { color: #272727; font-size: 16px; font-weight: 400; }
.nav-right { display: flex; align-items: center; }

.nav-cta, .back-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 0;
  border-radius: 12px;
  color: #272727;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  transform: translateX(var(--parallax-x, 0px)) translateY(var(--parallax-y, 0px));
  transition: all .2s ease, transform .15s ease;
  will-change: transform;
}

.nav-cta:hover, .back-link:hover { scale: 1.1; opacity: .6; }
.nav-cta-icon { width: 16px; height: 16px; }
.back-link { font-weight: 400; }
.back-arrow { width: 18px; height: 18px; }

/* Carousel */
.carousel-container {
  position: relative;
  width: 100%;
  height: min(65vh, 614px);
  min-height: 500px;
  margin-top: 100px;
  margin-bottom: 100px;
  -webkit-tap-highlight-color: transparent;
}

.carousel {
  position: absolute;
  left: 0;
  display: flex;
  align-items: center;
  height: 100%;
  transform: translateX(0);
}

.carousel.animate { transition: transform .5s ease-in-out; }

.carousel-item {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  height: 100%;
  margin: 0 20px;
  border: .5px solid #d0d0d0;
  border-radius: 30px;
  background: var(--bg, #fff);
  opacity: .2;
  filter: blur(6px);
  -webkit-transform: translateZ(0);
  will-change: opacity, filter;
}

.carousel-item.animate { transition: opacity .5s ease-in-out, filter .5s ease-in-out, margin .5s ease-in-out; }
.carousel-item.is-16-9 { height: min(max(45vh, 350px), 425px); }
.carousel-item.active { opacity: 1; filter: blur(0); }

.carousel-item img {
  width: auto;
  max-width: none;
  height: 100%;
  max-height: 100%;
  object-fit: contain;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
}

.carousel-item.is-empty {
  height: min(max(45vh, 350px), 425px);
  aspect-ratio: 16 / 9;
  color: #9b9b9b;
  background: #f6f6f6;
  font-size: 14px;
}

.click-zone { position: absolute; top: 0; bottom: 0; z-index: 2; width: 50%; }
.click-zone.left { left: 0; }
.click-zone.right { right: 0; }

/* Project label */
.carousel-overlay {
  position: absolute;
  top: 50%;
  left: 40px;
  z-index: 3;
  overflow: hidden;
  padding: 10px 18px;
  border-radius: 20px;
  color: #000;
  font-size: 16px;
  line-height: 20px;
  transform: translateX(var(--parallax-x, 0px)) translateY(calc(-50% + var(--parallax-y, 0px)));
  transition: height .5s cubic-bezier(.2, .6, .2, 1), background-color .18s ease, box-shadow .14s ease, border-color .18s ease, transform .2s ease, filter .2s ease;
  will-change: height, transform;
  contain: layout paint;
}

.carousel-overlay:focus-visible { outline: 2px solid #000; }

.carousel-overlay:hover {
  background-color: rgba(255, 255, 255, .75);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, .15));
  transform: translateX(var(--parallax-x, 0px)) translateY(calc(-50% + var(--parallax-y, 0px))) scale(1.05);
}

.carousel-overlay .title,
.carousel-overlay .meta {
  opacity: .92;
  transform: translateY(2px);
  transition: opacity .24s ease, transform .24s ease;
}

.carousel-overlay .title { margin-bottom: 4px; font-weight: 700; }
.carousel-overlay .meta { display: flex; align-items: center; gap: 8px; }
.carousel-overlay .year { color: #9b9b9b; font-weight: 700; }

.carousel-overlay .overlay-desc {
  position: absolute;
  top: 0;
  left: 0;
  overflow: hidden;
  visibility: hidden;
  width: 0;
  height: 0;
  margin-top: 0;
  font-size: 14px;
  line-height: 22px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity .24s ease, transform .24s ease;
  will-change: opacity, transform;
}

.carousel-overlay.is-open {
  width: 300px;
  padding: 22px 18px;
  border-radius: 24px;
  background-color: rgba(255, 255, 255, .75);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, .15));
  transform: translateX(var(--parallax-x, 0px)) translateY(calc(-50% + var(--parallax-y, 0px))) scale(1.05);
}

.carousel-overlay.is-open .title,
.carousel-overlay.is-open .meta { opacity: 1; transform: translateY(0); }

.carousel-overlay.is-open .overlay-desc {
  position: static;
  visibility: visible;
  width: auto;
  height: auto;
  margin-top: 40px;
  margin-bottom: 20px;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  transition: opacity 1s cubic-bezier(.2, .8, .2, 1) .1s, transform .42s cubic-bezier(.2, .8, .2, 1) .1s;
}

/* Footer */
.site-footer {
  width: calc(100% - 90px);
  margin: 0 auto;
  padding: 22px 0 26px;
  font-size: 11px;
}

.footer-inner { display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: center; }
.footer-left, .footer-right { display: flex; align-items: center; gap: 4px; }
.footer-left { grid-column: 1; justify-self: start; }
.footer-right { grid-column: 3; justify-self: end; }
.footer-text { color: #c7c7c7; font-weight: 700; }

.footer-link {
  display: inline-block;
  padding: 0 5px;
  color: #9b9b9b;
  font-weight: 700;
  text-decoration: none;
  transform: translate(var(--parallax-x, 0px), var(--parallax-y, 0px));
  transition: color .14s ease, transform .14s ease;
}

.footer-link:hover { color: #000; }

/* Custom cursor */
.custom-cursor {
  position: fixed;
  z-index: 10001;
  display: none;
  overflow: hidden;
  width: 40px;
  height: 40px;
  border: 1.5px solid #fff;
  border-radius: 50%;
  background: rgba(255, 255, 255, .7);
  box-shadow: 0 3px 6px 3px rgba(9, 9, 2, .1);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  filter: blur(0);
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: width .15s ease, height .15s ease, opacity .15s ease, filter .15s ease, border-color .15s ease;
  will-change: left, top;
}

.custom-cursor::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(240, 240, 240, .2);
  opacity: 0;
  transition: opacity .15s ease;
}

.custom-cursor.pressing { width: 34px; height: 34px; box-shadow: 0 2px 6px 2px rgba(9, 9, 2, .1); }
.custom-cursor.pressing::before { opacity: 1; }
.custom-cursor.hide-on-overlay { width: 1px; height: 1px; border: 0; box-shadow: none; opacity: 0; filter: blur(6px); }

.has-custom-cursor, .has-custom-cursor * { cursor: none !important; }

/* Page fade */
.main-content { opacity: 0; transition: opacity .6s ease-out; }
.main-content.loaded { opacity: 1; }

/* More info */
#more-info-view { overflow: visible; color: #272727; font-size: 26px; line-height: 35px; }
#more-info-view .top-nav { z-index: auto; margin-bottom: 0; padding: 30px 60px; line-height: 38px; }
#more-info-view h1, #more-info-view h2 { font-weight: 400; }
#more-info-view h2 { margin: 0 0 16px; color: #272727; font-size: 32px; }
.single-column { display: block; width: 100%; max-width: 600px; margin: 0 auto; padding-top: 40px; }
.nav-time { color: #ccc; font-size: 16px; }
.about-intro { margin-bottom: 60px; }
.about-intro h1 { margin: 0 0 24px; font-size: 42px; line-height: 1.1; }
.about-intro-text { margin: 0; color: #272727; font-size: 18px; line-height: 30px; text-align: left; }

.about-intro-hidden {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height .5s cubic-bezier(.4, 0, .2, 1), opacity .4s linear;
}

.about-intro-hidden.expanded {
  margin-top: 16px;
  opacity: 1;
  transition: max-height .5s cubic-bezier(.4, 0, .2, 1), opacity .3s ease .1s;
}

.read-more-btn {
  display: inline-block;
  margin-top: 16px;
  padding: 0;
  border: 0;
  color: #ccc;
  background: none;
  font: inherit;
  font-size: 16px;
  line-height: 24px;
  transform: translateX(var(--parallax-x, 0px)) translateY(var(--parallax-y, 0px));
  transition: color .2s ease, transform .15s ease;
  will-change: transform;
}

.read-more-btn:hover { color: #272727; }
.about-section { display: flow-root; margin-bottom: 40px; }

.about-list-item {
  display: block;
  width: 100%;
  padding: 10px 0;
  border-radius: 18px;
  color: #666;
  background-color: rgba(238, 238, 238, 0);
  font-size: 18px;
  line-height: 28px;
  backface-visibility: hidden;
  transform: translateX(var(--parallax-x, 0px)) translateY(var(--parallax-y, 0px));
  transition: background-color .5s ease, scale .5s ease, color .5s ease, transform .15s ease;
  will-change: transform;
}

.about-list-content { margin: 0; transition: .5s all ease; }
.about-list-right { float: right; color: #ccc; transition: .5s all ease; }
.about-list-item:hover { color: #000; background-color: #eee; scale: 1.07; transition: background-color .15s ease, scale .15s ease, color .15s ease, transform .15s ease; }
.about-list-item:hover .about-list-content { margin: 0 18px; transition: .15s all ease; }
.about-list-item:hover .about-list-right { color: #555; transition: .15s all ease; }

@media (max-width: 950px) {
  #more-info-view .top-nav { padding: 20px; }
  .single-column { width: auto; padding: 20px 30px 0; }
  .about-intro h1 { font-size: 36px; }
  #more-info-view h2 { font-size: 28px; }
  .about-intro-text { line-height: 28px; }
  .about-list-item { line-height: 26px; }
  .read-more-btn { font-size: 18px; }
  .back-link { font-size: 18px; }
}

@media (max-width: 920px) {
  .top-nav { margin-bottom: 0; padding: 20px; }

  .carousel-container {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 0;
    margin-top: 40px;
    margin-bottom: 60px;
    touch-action: pan-y;
  }

  .carousel { position: relative; align-self: flex-start; height: auto; }

  .carousel-item, .carousel-item.is-empty {
    width: 74vw;
    height: 74vw;
    aspect-ratio: auto;
    opacity: .1;
    filter: none;
  }

  .carousel-item.active { opacity: 1; filter: none; }
  .carousel-item img { width: 100%; height: 100%; object-fit: contain; }

  .click-zone { bottom: auto; height: 74vw; }

  .carousel-overlay {
    position: static;
    order: 2;
    z-index: 1;
    width: 80vw;
    margin: 12px auto 0;
    text-align: center;
    transform: none;
  }

  .carousel-overlay .meta { justify-content: center; }
  .carousel-overlay:hover { filter: drop-shadow(0 10px 20px rgba(0, 0, 0, .15)); transform: scale(1.1); }

  .carousel-overlay.is-open { width: 80vw; text-align: center; transform: none; }

  .site-footer { width: auto; margin-top: 20px; padding: 15px 14px; }
  .footer-inner { display: flex; flex-direction: column; gap: 10px; }
  .footer-right { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .carousel.animate, .carousel-item.animate, .carousel-overlay, .main-content { transition: none; }
}
