:root {
  --gray-00: #e7e7e7;
  --gray-10: #dddddd;
  --gray-20: #cfcfcf;
  --gray-40: #8c8c8c;
  --gray-80: #222222;
  --text-main: #121212;
  --accent: #d0a02c;
  --white: #ffffff;
  --page-edge-bg: linear-gradient(180deg, #2d2a27 0%, #05090f 18%, #05090f 82%, #2f3030 100%);
  --landing-photo: url("./public/landing/landing-01.jpg");
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: #05090f;
  background-image: var(--page-edge-bg);
}

body {
  font-family: "Manrope", sans-serif;
  background: #05090f;
  background-image: var(--page-edge-bg);
  color: var(--text-main);
  overflow: hidden;
}

button {
  font: inherit;
}

.is-hidden {
  display: none !important;
}

/* Landing */
.landing-view {
  min-height: 100vh;
  min-height: 100svh;
  position: relative;
  display: grid;
  place-items: center;
  padding: 1.2rem;
  overflow: hidden;
  background: #05090f;
  background-image: var(--page-edge-bg);
}

.landing-scene {
  position: absolute;
  inset: -5%;
  z-index: 0;
}

.landing-photo-bg {
  position: absolute;
  inset: 0;
  background-image: var(--landing-photo);
  background-position: center;
  background-size: cover;
  filter: saturate(0.92) contrast(1.08);
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 1.4s ease;
}

.landing-photo-bg.is-active {
  opacity: 1;
}

.landing-scene::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg, rgba(5, 9, 15, 0.46), rgba(5, 9, 15, 0.18) 50%, rgba(5, 9, 15, 0.44)),
    radial-gradient(circle at center, rgba(5, 9, 15, 0.03), rgba(5, 9, 15, 0.38));
}

.scene-glow {
  position: absolute;
  border-radius: 999px;
  filter: blur(50px);
  opacity: 0;
  transition: opacity 1.4s ease;
}

.landing-view.has-landing-photo .scene-glow {
  opacity: 0.16;
}

.scene-glow-a {
  width: 48vw;
  height: 48vw;
  min-width: 320px;
  min-height: 320px;
  left: -12vw;
  top: -8vw;
  background: #d5914f;
}

.scene-glow-b {
  width: 40vw;
  height: 40vw;
  min-width: 280px;
  min-height: 280px;
  right: -10vw;
  bottom: -10vw;
  background: #5a91c6;
}

.scene-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 70px 70px;
  mask-image: radial-gradient(circle at center, black 35%, transparent 90%);
  opacity: 0;
  transition: opacity 1.4s ease;
}

.landing-view.has-landing-photo .scene-grid {
  opacity: 0.45;
}

.landing-card {
  position: relative;
  z-index: 2;
  width: 100%;
  min-height: 100vh;
  padding: clamp(1.2rem, 4vw, 4rem);
  display: grid;
  grid-template-rows: 1fr auto;
  text-shadow: 0 10px 44px rgba(0, 0, 0, 0.72);
}

.landing-view.is-sliding-out,
.landing-view.is-sliding-in,
.portfolio-view.is-sliding-in,
.portfolio-view.is-sliding-out {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
  will-change: transform;
}

.landing-view.is-sliding-out {
  z-index: 2;
  animation: landing-slide-out 0.62s cubic-bezier(0.68, 0, 0.32, 1) forwards;
}

.landing-view.is-sliding-in {
  z-index: 3;
  animation: landing-slide-in 0.62s cubic-bezier(0.68, 0, 0.32, 1) forwards;
}

.portfolio-view.is-sliding-in {
  z-index: 3;
  animation: portfolio-slide-in 0.62s cubic-bezier(0.68, 0, 0.32, 1) forwards;
}

.portfolio-view.is-sliding-out {
  z-index: 2;
  animation: portfolio-slide-out 0.62s cubic-bezier(0.68, 0, 0.32, 1) forwards;
}

.landing-card-center {
  display: grid;
  place-content: start;
  text-align: left;
}

.landing-brand h1 {
  margin: 0;
  font-family: "Montserrat", sans-serif;
  font-weight: 500;
  font-size: clamp(2.9rem, 9vw, 9rem);
  color: #ffffff;
  letter-spacing: 0;
  line-height: 0.78;
}

.landing-brand h1 span {
  display: block;
}

.landing-brand p {
  margin: 0.54rem 0 0;
  font-family: "Montserrat", sans-serif;
  font-weight: 500;
  font-size: clamp(0.9rem, 2.1vw, 2.2rem);
  color: #ffffff;
  letter-spacing: 0;
  line-height: 1.08;
  transform: translateX(0.31em);
}

.enter-button {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #ffffff;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 800;
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  padding: 0.45rem 0;
  cursor: pointer;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.92), 0 8px 28px rgba(0, 0, 0, 0.72);
  transition: color 0.18s ease, transform 0.2s ease, text-shadow 0.2s ease;
}

.enter-button::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.22rem;
  height: 1px;
  background: currentColor;
  opacity: 0.72;
  pointer-events: none;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.enter-button span {
  position: relative;
  z-index: 1;
}

.enter-button:hover,
.enter-button:focus-visible {
  color: #ffffff;
  outline: none;
  transform: translateY(-2px);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 1), 0 12px 34px rgba(0, 0, 0, 0.82);
}

.enter-button:hover::after,
.enter-button:focus-visible::after {
  transform: scaleX(1);
}

.enter-button:active {
  transform: translateY(0);
}

/* Portfolio */
.portfolio-view {
  --sidebar-width: 310px;
  --panel-top: 1.55rem;
  height: 100vh;
  min-height: 100vh;
  position: relative;
  background: #ffffff;
}

@keyframes landing-slide-out {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-100%);
  }
}

@keyframes landing-slide-in {
  from {
    transform: translateX(-100%);
  }

  to {
    transform: translateX(0);
  }
}

@keyframes portfolio-slide-in {
  from {
    transform: translateX(100%);
  }

  to {
    transform: translateX(0);
  }
}

@keyframes portfolio-slide-out {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(100%);
  }
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  background: #ffffff;
  padding: var(--panel-top) 0.8rem 1.2rem;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 2.2rem;
  overflow: auto;
  z-index: 10;
  transition: transform 0.45s cubic-bezier(0.22, 0.62, 0.23, 1), opacity 0.35s ease;
  box-shadow: 2px 0 0 rgba(0, 0, 0, 0.06);
}

.portfolio-view.sidebar-hidden .sidebar {
  transform: translateX(calc(-1 * var(--sidebar-width) - 16px));
  opacity: 0;
  pointer-events: none;
}

.sidebar-title {
  margin: 0;
  font-family: "Montserrat", sans-serif;
  font-weight: 800;
  font-size: clamp(1.02rem, 1.42vw, 1.58rem);
  letter-spacing: 0;
  line-height: 1;
}

.sidebar-subtitle {
  margin: 0.35rem 0 0;
  font-family: "Montserrat", sans-serif;
  font-weight: 500;
  font-size: clamp(0.62rem, 0.78vw, 0.76rem);
  color: #5c5c5c;
  letter-spacing: 0;
  line-height: 1.08;
}

.sidebar-block {
  display: grid;
  gap: 0.55rem;
}

.sidebar-label {
  margin: 0;
  color: #111111;
  font-family: "Montserrat", sans-serif;
  font-size: clamp(0.78rem, 0.95vw, 0.92rem);
  letter-spacing: 0;
  font-weight: 700;
}

.album-nav {
  display: grid;
  gap: 0.26rem;
}

.album-link {
  text-align: left;
  border: 0;
  background: transparent;
  color: #8a8a8a;
  font-family: "Montserrat", sans-serif;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: clamp(0.62rem, 0.78vw, 0.74rem);
  padding: 0.15rem 0;
  cursor: pointer;
  transition: color 0.2s ease;
}

.album-link.is-active {
  color: #8a8a8a;
}

.album-link:hover,
.album-link.is-active:hover {
  color: var(--accent);
}

.sidebar-meta-links {
  align-content: end;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 0.7rem;
}

.sidebar-view-links {
  display: grid;
  gap: 0.5rem;
}

.sidebar-chevron {
  align-self: start;
  margin-top: 0.1rem;
}

.sidebar-link {
  border: 0;
  text-align: left;
  padding: 0;
  background: transparent;
  color: #8a8a8a;
  font-family: "Montserrat", sans-serif;
  text-transform: uppercase;
  font-weight: 500;
  font-size: clamp(0.72rem, 1.02vw, 1.08rem);
  letter-spacing: 0;
  line-height: 1.12;
  cursor: pointer;
}

.sidebar-link.is-active,
.sidebar-link:hover {
  color: #3d3d3d;
}

.portfolio-content {
  margin-left: var(--sidebar-width);
  height: 100vh;
  min-height: 100vh;
  padding: var(--panel-top) 1rem 0.9rem;
  background: #ffffff;
  overflow-y: auto;
  overflow-x: hidden;
  transition: margin-left 0.45s cubic-bezier(0.22, 0.62, 0.23, 1);
}

.portfolio-view.sidebar-hidden .portfolio-content {
  margin-left: 0;
}

.portfolio-view.slideshow-mode .portfolio-content {
  overflow: hidden;
}

.content-header {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 1rem;
  padding: 0 0.2rem 0.8rem;
  background: #ffffff;
}

.content-header::before {
  content: "";
  position: absolute;
  inset: calc(-1 * var(--panel-top)) -1rem 0 -1rem;
  z-index: 0;
  background: #ffffff;
}

.content-heading {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.08rem;
}

.content-title {
  margin: 0;
  font-family: "Montserrat", sans-serif;
  text-transform: uppercase;
  font-weight: 800;
  font-size: clamp(1.02rem, 1.42vw, 1.58rem);
  letter-spacing: 0.02em;
  line-height: 1;
}

.content-description {
  margin: 0;
  color: #666666;
  font-family: "Montserrat", sans-serif;
  font-size: clamp(0.62rem, 0.78vw, 0.76rem);
  white-space: normal;
  line-height: 1.08;
}

.menu-chevron {
  width: 62px;
  height: 62px;
  -webkit-appearance: none;
  appearance: none;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0;
  color: #5f5f5f;
  font-family: "Montserrat", sans-serif;
  font-size: 2.5rem;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.menu-chevron:focus,
.menu-chevron:focus-visible {
  outline: none;
}

.menu-chevron:hover {
  color: #1f1f1f;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.28));
}

.portfolio-view.sidebar-hidden .menu-chevron {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-10px);
}

.reveal-sidebar {
  position: fixed;
  left: 16px;
  bottom: 20px;
  top: auto;
  transform: translateY(8px);
  opacity: 0;
  pointer-events: none;
  z-index: 20;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 1px solid #b8b8b8;
  background: #ffffff;
  color: #5a5a5a;
  font-family: "Montserrat", sans-serif;
  border-radius: 999px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: opacity 0.28s ease, transform 0.35s cubic-bezier(0.22, 0.62, 0.23, 1), box-shadow 0.25s ease,
    color 0.2s ease;
}

.reveal-icon {
  position: relative;
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
}

.reveal-icon::before,
.reveal-icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 20px;
  height: 2px;
  background: currentColor;
}

.reveal-icon::before {
  top: -7px;
}

.reveal-icon::after {
  top: 7px;
}

.portfolio-view.sidebar-hidden .reveal-sidebar {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

@media (min-width: 981px) {
  .portfolio-view:not(.sidebar-hidden) .reveal-sidebar {
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
  }
}

.reveal-sidebar:hover {
  color: #1f1f1f;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.gallery-view {
  columns: 3 300px;
  column-gap: 12px;
  min-height: calc(100vh - 120px);
  padding: 0 0.2rem 1.1rem 0.2rem;
  background: #ffffff;
}

.gallery-item {
  display: flex;
  align-items: flex-start;
  width: 100%;
  margin: 0;
  padding: 0 0 12px;
  border: 0;
  -webkit-column-break-inside: avoid;
  break-inside: avoid-column;
  background: transparent;
  cursor: pointer;
  position: relative;
}

.gallery-item::after {
  content: "";
  position: absolute;
  inset: 0 0 12px 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  border: 0;
  outline: 0;
}

.gallery-item-label {
  position: absolute;
  inset: 0 0 12px 0;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 0.55rem 0.65rem;
  color: #f3f3f3;
  font-family: "Montserrat", sans-serif;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0;
  transform: scale(0.985);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  z-index: 1;
}

.gallery-item:hover::after,
.gallery-item:focus-visible::after {
  opacity: 1;
}

.gallery-item:hover .gallery-item-label,
.gallery-item:focus-visible .gallery-item-label {
  opacity: 1;
  transform: scale(1);
}

.empty-state {
  border: 1px dashed #bcbcbc;
  padding: 1rem;
  color: #646464;
  font-size: 0.92rem;
  min-width: 340px;
}

.slideshow-view {
  height: auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 54px 1fr 54px;
  grid-template-rows: 1fr auto;
  align-items: center;
  gap: 0.45rem;
  background: #ffffff;
  padding: 0.35rem 0.25rem 0.6rem;
}

.portfolio-view.slideshow-mode .slideshow-view {
  height: calc(100vh - var(--panel-top) - 7.3rem);
}

.slide-stage {
  margin: 0;
  grid-column: 2;
  grid-row: 1;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
}

.portfolio-view.slideshow-mode .slide-stage {
  gap: 0.35rem;
}

.slide-stage img {
  width: 100%;
  height: auto;
  max-height: min(88vh, 980px);
  object-fit: contain;
  background: transparent;
}

.portfolio-view.slideshow-mode .slide-stage img {
  max-height: calc(100% - 1.6rem);
}

.slide-stage img.slide-enter-right {
  animation: slideEnterRight 0.45s ease;
}

.slide-stage img.slide-enter-left {
  animation: slideEnterLeft 0.45s ease;
}

@keyframes slideEnterRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideEnterLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.slide-stage figcaption {
  color: #3f3f3f;
  font-size: 0.86rem;
  text-align: center;
}

.slide-nav {
  border: 1px solid #c3c3c3;
  background: #ffffff;
  color: #4f4f4f;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  cursor: pointer;
  justify-self: center;
}

.slide-counter {
  grid-column: 1 / -1;
  grid-row: 2;
  justify-self: center;
  margin: 0;
  color: #6f6f6f;
  letter-spacing: 0.06em;
  font-size: 0.76rem;
}

@media (max-width: 1320px) {
  .portfolio-view {
    --sidebar-width: 280px;
  }
}

@media (max-width: 980px) {
  body {
    overflow: auto;
  }

  .portfolio-view {
    height: auto;
    min-height: 100vh;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(82vw, 310px);
    transform: translateX(-100%);
    opacity: 0;
    pointer-events: none;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.18);
    grid-template-rows: auto auto 1fr;
    z-index: 21;
  }

  .portfolio-view:not(.sidebar-hidden) .sidebar {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
  }

  .portfolio-view:not(.sidebar-hidden)::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 9;
    background: rgba(0, 0, 0, 0.18);
  }

  .portfolio-content {
    margin-left: 0;
    height: auto;
    min-height: auto;
    padding-top: 0;
    overflow: visible;
  }

  .content-header {
    position: sticky;
    top: 0;
    z-index: 8;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(18px);
    padding: max(0.85rem, env(safe-area-inset-top)) 4.5rem 0.85rem 0.9rem;
  }

  .gallery-view {
    columns: 2 220px;
    min-height: auto;
    padding-top: 0.75rem;
  }

  .reveal-sidebar {
    display: grid !important;
    position: fixed;
    top: auto !important;
    right: auto !important;
    bottom: max(20px, env(safe-area-inset-bottom));
    left: max(16px, env(safe-area-inset-left));
    z-index: 30;
    width: 56px;
    height: 56px;
    border: 1px solid #b8b8b8;
    border-radius: 999px;
    background: #ffffff;
    color: #5a5a5a;
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: none !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
  }

  .portfolio-view.sidebar-hidden .reveal-sidebar {
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }

  .portfolio-view:not(.sidebar-hidden) .reveal-sidebar {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateY(8px) !important;
  }

  .reveal-sidebar:hover {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  }

  .sidebar-meta-links {
    grid-template-columns: 1fr auto;
    align-items: end;
  }

  .menu-chevron {
    display: grid;
    width: 62px;
    height: 62px;
    align-self: end;
    background: transparent !important;
    color: #5f5f5f;
    font-size: 2.5rem;
  }

  .portfolio-view.sidebar-hidden .menu-chevron {
    opacity: 0;
    pointer-events: none;
    transform: none;
  }

  .content-heading {
    flex-wrap: wrap;
    gap: 0.15rem 0.6rem;
  }

  .content-description {
    white-space: normal;
  }

  .slideshow-view {
    height: auto;
    min-height: 68vh;
  }
}

@media (max-width: 640px) {
  html.is-landing-visible,
  html.is-landing-visible body {
    background-color: #05090f;
    background-image: linear-gradient(180deg, rgba(5, 9, 15, 0.55), rgba(5, 9, 15, 0.12) 42%, rgba(5, 9, 15, 0.62)),
      var(--landing-photo);
    background-position: center;
    background-size: cover;
  }

  .landing-view {
    align-items: stretch;
    justify-items: stretch;
    min-height: 100vh;
    min-height: 100lvh;
    padding: 0;
  }

  .landing-card {
    min-height: 100vh;
    min-height: 100dvh;
    padding: max(1.1rem, env(safe-area-inset-top)) 1.05rem 1.6rem;
  }

  .landing-scene {
    inset: -8% 0;
  }

  .landing-scene::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    background: linear-gradient(
      180deg,
      rgba(5, 9, 15, 0.86) 0%,
      rgba(5, 9, 15, 0.46) 7%,
      rgba(5, 9, 15, 0) 18%,
      rgba(5, 9, 15, 0) 82%,
      rgba(5, 9, 15, 0.46) 93%,
      rgba(5, 9, 15, 0.86) 100%
    );
    pointer-events: none;
  }

  .landing-brand h1 {
    font-size: clamp(3.9rem, 19vw, 5.1rem);
    line-height: 0.82;
  }

  .landing-brand p {
    margin-top: 0.48rem;
    font-size: clamp(1rem, 5vw, 1.28rem);
    transform: translateX(0.31em);
  }

  .portfolio-content {
    padding: 0.75rem;
  }

  .gallery-view {
    columns: 1 260px;
  }

  .slideshow-view {
    grid-template-columns: 42px 1fr 42px;
    padding: 0.55rem;
  }

  .slide-nav {
    width: 38px;
    height: 38px;
  }
}
