/* ============================================
   Projects Page - Scoped Styles
   Root class: .projects-page
   ============================================ */

body {
  margin: 0;
  padding: 0;
}

.projects-page {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  background: #f5f5f7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

.projects-page *,
.projects-page *::before,
.projects-page *::after {
  box-sizing: inherit;
  margin: 0;
  padding: 0;
}

/* --- Header (same pattern as about) --- */
.projects-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 40px;
}

.projects-header__logo {
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  flex-shrink: 0;
  width: 160px;
}

.projects-header__logo-icon {
  height: 40px;
  width: auto;
  filter: none;
}

.projects-header__logo-text {
  height: 30px;
  width: auto;
  margin-top: 4px;
  filter: none;
}

.projects-header__nav {
  display: flex;
  align-items: center;
  gap: 54px;
}

.projects-header__nav-link {
  font-family: "Futura", "Century Gothic", "Trebuchet MS", Arial, sans-serif !important;
  font-weight: 500;
  font-size: 14px;
  line-height: 1;
  color: #003057;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.3s ease;
  position: relative;
  padding-bottom: 4px;
}

.projects-header__nav-link:hover {
  opacity: 0.7;
}

.projects-header__nav-link.is-active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: #bda600;
}

.projects-header__lang {
  flex-shrink: 0;
}

.projects-header__lang-btn {
  font-family: "Futura", "Century Gothic", "Trebuchet MS", Arial, sans-serif !important;
  font-weight: 500;
  font-size: 14px;
  line-height: 1;
  color: #003057;
  background: none;
  border: none;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.projects-header__lang-btn:hover {
  opacity: 0.7;
}

/* --- Title --- */
.projects-title {
  padding: 40px 204px 60px;
}

.projects-title__heading {
  font-family: "Futura", "Century Gothic", "Trebuchet MS", Arial, sans-serif !important;
  font-weight: 500;
  font-size: 54px;
  line-height: 1;
  color: #003057;
}

/* --- Gallery (Desktop: editorial layout) --- */
.projects-gallery {
  position: relative;
  width: 100%;
  min-height: 2400px;
  padding: 0 0 80px;
}

.projects-gallery__item {
  display: flex;
  gap: 56px;
  align-items: flex-start;
}

.projects-gallery__link {
  display: block;
  flex-shrink: 0;
  overflow: hidden;
}

.projects-gallery__image {
  position: relative;
  overflow: hidden;
}

.projects-gallery__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(100%);
  mix-blend-mode: luminosity;
  transition: filter 0.5s ease;
}

.projects-gallery__link:hover .projects-gallery__image img {
  filter: grayscale(0%);
  mix-blend-mode: normal;
}

/* Hover overlay text: "OPEN / line / CASE" (matches Figma 594:1008) */
.projects-gallery__hover {
  visibility: hidden;
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  display: flex;
  justify-content: center;
  opacity: 0;
  z-index: 2;
  pointer-events: none;
  transition:
    opacity 0.5s ease,
    visibility 0.5s step-end;
}

.projects-gallery__link:hover .projects-gallery__hover {
  opacity: 1;
  visibility: visible;
  transition:
    opacity 0s linear,
    visibility 0s step-start;
}

.projects-gallery__hover-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 75.68%; /* Figma: 890 / 1176 */
  max-width: 890px;
}

.projects-gallery__hover-word {
  overflow: hidden;
  width: 100%;
  text-align: center;
  font-family: "Futura", "Century Gothic", "Trebuchet MS", Arial, sans-serif !important;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.56px;
  text-transform: uppercase;
  color: #fff;
}

.projects-gallery__hover-word span {
  display: block;
  transform: translate3d(0, 15px, 1px) rotate(6deg);
  transform-origin: 0 0;
  transition: transform 0s linear 0.5s;
}

.projects-gallery__link:hover .projects-gallery__hover-word span {
  transform: translateZ(1px) rotate(0.001deg);
  transition: transform 1s ease 0.7s;
}

.projects-gallery__hover-line {
  width: 100%;
  height: 1px;
  background: #fff;
  transform: scaleX(0);
  transform-origin: 0 0;
  transition: transform 0s linear 0.5s;
}

.projects-gallery__link:hover .projects-gallery__hover-line {
  transform: scaleX(1);
  transition: transform 0.8s ease 0.3s;
}

.projects-gallery__info {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.projects-gallery__info--reverse {
  text-align: right;
}

.projects-gallery__name {
  font-family: "Futura", "Century Gothic", "Trebuchet MS", Arial, sans-serif !important;
  font-weight: 500;
  font-size: 32px;
  line-height: 1.5;
  color: #003057;
}

.projects-gallery__details {
  font-family: "Montserrat", sans-serif !important;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  color: #1c1c1c;
  letter-spacing: 0.96px;
}

.projects-gallery__details p {
  margin-bottom: 0;
  font-family: "Montserrat", sans-serif !important;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  color: #1c1c1c;
  letter-spacing: 0.96px;
}

/* Mobile-only details hidden on desktop */
.projects-gallery__details-mobile {
  display: none;
}

/* --- Desktop layout: absolute positioning --- */
.projects-gallery__item--osaka {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  padding: 0 0 0 0;
}

.projects-gallery__item--osaka .projects-gallery__link {
  width: 61.25%;
}

.projects-gallery__item--osaka .projects-gallery__image {
  width: 100%;
  height: 676px;
}

.projects-gallery__item--osaka .projects-gallery__info {
  width: 461px;
}

/* El Nido */
.projects-gallery__item--elnido {
  position: absolute;
  left: 120px;
  top: 764px;
  flex-direction: column;
  gap: 28px;
  width: 826px;
}

.projects-gallery__item--elnido .projects-gallery__link {
  width: 100%;
}

.projects-gallery__item--elnido .projects-gallery__image {
  width: 100%;
  height: 473px;
}

.projects-gallery__item--elnido .projects-gallery__info {
  width: 461px;
}

/* Tokyo */
.projects-gallery__item--tokyo {
  position: absolute;
  right: 120px;
  top: 512px;
  flex-direction: column;
  gap: 24px;
  width: 568px;
}

.projects-gallery__item--tokyo .projects-gallery__link {
  width: 100%;
}

.projects-gallery__item--tokyo .projects-gallery__image {
  width: 100%;
  height: 744px;
}

.projects-gallery__item--tokyo .projects-gallery__info {
  width: 461px;
}

/* Sapporo (reverse: info left, image right) */
.projects-gallery__item--sapporo {
  position: absolute;
  right: 0;
  top: 1580px;
  width: 100%;
  flex-direction: row-reverse;
  padding: 0;
}

.projects-gallery__item--sapporo .projects-gallery__link {
  width: 61.25%;
}

.projects-gallery__item--sapporo .projects-gallery__image {
  width: 100%;
  height: 676px;
}

.projects-gallery__item--sapporo .projects-gallery__info {
  width: 461px;
  align-items: flex-end;
}

/* --- Footer --- */
.projects-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 40px;
}

.projects-footer__left {
  display: flex;
  align-items: center;
  gap: 54px;
}

.projects-footer__text,
.projects-footer__link {
  font-family: "Futura", "Century Gothic", "Trebuchet MS", Arial, sans-serif !important;
  font-weight: 500;
  font-size: 14px;
  line-height: 1;
  color: #003057;
  white-space: nowrap;
}

.projects-footer__link {
  text-decoration: none;
  transition: opacity 0.3s ease;
}

.projects-footer__link:hover {
  opacity: 0.7;
}

/* --- Mobile bar (hidden on desktop) --- */
.projects-header__mobile-bar {
  display: none;
}

.projects-header__hamburger {
  width: 72px;
  height: 20px;
  border: none;
  border-top: 2px solid #d0d0d0;
  border-bottom: 2px solid #d0d0d0;
  background: none;
  cursor: pointer;
  padding: 0;
}

.projects-header__mobile-lang {
  font-family: "Futura", "Century Gothic", "Trebuchet MS", Arial, sans-serif !important;
  font-weight: 500;
  font-size: 14px;
  line-height: 1;
  color: #d0d0d0;
  white-space: nowrap;
}

/* ============================================
   RWD - Responsive
   ============================================ */

@media (max-width: 1440px) {
  .projects-title {
    padding: 40px 100px 60px;
  }

  .projects-gallery__item--osaka .projects-gallery__image,
  .projects-gallery__item--sapporo .projects-gallery__image {
    height: 500px;
  }

  .projects-gallery__item--tokyo .projects-gallery__image {
    height: 580px;
  }

  .projects-gallery__item--elnido .projects-gallery__image {
    height: 380px;
  }

  .projects-gallery {
    min-height: 1900px;
  }

  .projects-gallery__item--elnido {
    top: 600px;
    width: 50%;
  }

  .projects-gallery__item--tokyo {
    top: 400px;
    width: 35%;
  }

  .projects-gallery__item--sapporo {
    top: 1200px;
  }
}

@media (max-width: 1024px) {
  .projects-header {
    padding: 20px 24px;
  }

  .projects-header__nav {
    gap: 32px;
  }

  .projects-title {
    padding: 32px 40px 40px;
  }

  .projects-title__heading {
    font-size: 40px;
  }

  /* Switch to simple vertical layout on tablet */
  .projects-gallery {
    position: static;
    min-height: auto;
    display: flex;
    flex-direction: column;
    gap: 60px;
    padding: 0 40px 60px;
  }

  .projects-gallery__item,
  .projects-gallery__item--osaka,
  .projects-gallery__item--elnido,
  .projects-gallery__item--tokyo,
  .projects-gallery__item--sapporo {
    position: static;
    flex-direction: column;
    gap: 24px;
    width: 100%;
    padding: 0;
  }

  .projects-gallery__item--sapporo {
    flex-direction: column;
  }

  .projects-gallery__link {
    width: 100% !important;
  }

  .projects-gallery__image {
    width: 100%;
    height: auto !important;
    aspect-ratio: 16 / 10;
  }

  .projects-gallery__info,
  .projects-gallery__info--reverse {
    width: 100% !important;
    text-align: left;
    align-items: flex-start !important;
  }

  .projects-footer {
    padding: 20px 24px;
  }

  .projects-footer__left {
    gap: 32px;
  }
}

@media (max-width: 768px) {
  /* --- Header --- */
  .projects-header {
    padding: 12px 20px 0;
    gap: 22px;
    justify-content: flex-start;
  }

  .projects-header__nav {
    display: none;
  }

  .projects-header__lang {
    display: none;
  }

  .projects-header__logo {
    width: auto;
    gap: 4px;
  }

  .projects-header__logo-icon {
    height: 20px;
  }

  .projects-header__logo-text {
    height: 15px;
    margin-top: 3px;
  }

  .projects-header__mobile-bar {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: flex-end;
    gap: 24px;
    height: 67px;
    padding: 20px 20px 20px 10px;
    background: #1c1c1c;
  }

  /* --- Title --- */
  .projects-title {
    padding: 20px;
  }

  .projects-title__heading {
    font-size: 32px;
  }

  /* --- Gallery: vertical cards --- */
  .projects-gallery {
    padding: 0 0 60px;
    gap: 32px;
  }

  .projects-gallery__item {
    padding: 0 20px;
    gap: 4px;
  }

  .projects-gallery__image {
    aspect-ratio: 375 / 240 !important;
  }

  .projects-gallery__item--tokyo .projects-gallery__image {
    aspect-ratio: 335 / 443 !important;
  }

  /* Full color on mobile */
  .projects-gallery__image img {
    filter: none;
    mix-blend-mode: normal;
  }

  /* Hide desktop hover overlay on mobile */
  .projects-gallery__hover {
    display: none;
  }

  .projects-gallery__name {
    font-size: 20px;
  }

  /* Show abbreviated mobile details, hide full details */
  .projects-gallery__details {
    display: none;
  }

  .projects-gallery__details-mobile {
    display: block;
    font-family: "Montserrat", sans-serif !important;
    font-weight: 400;
    font-size: 14px;
    line-height: 1.5;
    color: #1c1c1c;
    letter-spacing: 0.84px;
  }

  .projects-gallery__details-mobile p {
    margin-bottom: 0;
    font-family: "Montserrat", sans-serif !important;
    font-weight: 400;
    font-size: 14px;
    line-height: 1.5;
    color: #1c1c1c;
    letter-spacing: 0.84px;
  }

  .projects-gallery__info {
    gap: 4px;
  }

  /* --- Footer --- */
  .projects-footer {
    display: grid;
    grid-template-columns: auto auto;
    grid-template-areas:
      "year linkedin"
      "privacy legal";
    justify-content: center;
    justify-items: center;
    align-items: center;
    gap: 24px 19px;
    padding: 16px 12px 32px;
  }

  .projects-footer__left {
    display: contents;
  }

  .projects-footer__right {
    display: contents;
  }

  .projects-footer__text {
    grid-area: year;
  }

  .projects-footer__right .projects-footer__link {
    grid-area: linkedin;
  }

  .projects-footer__left a:nth-of-type(1) {
    grid-area: privacy;
  }

  .projects-footer__left a:nth-of-type(2) {
    grid-area: legal;
  }

  .projects-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0 19px;
  }

  .projects-footer::after {
    content: "";
    flex-basis: 100%;
    height: 0;
    order: 3;
  }

  .projects-footer__text {
    order: 1;
  }
  .projects-footer__right .projects-footer__link {
    order: 2;
  }
  .projects-footer__left a:nth-of-type(1) {
    order: 4;
    margin-top: 24px;
  }
  .projects-footer__left a:nth-of-type(2) {
    order: 5;
    margin-top: 24px;
    margin-left: -7px;
  }
}
