:root {
  --bg: #040a10;
  --text-main: #e0e0e0;
  --text-muted: #888888;
  --purple: #5b1bff;
  --line: #2f1ea0;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  font-family: "Courier New", Courier, monospace;
  background: var(--bg);
  color: var(--text-main);
}

.code-rain {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  opacity: 0.78;
}

.page {
  width: 100%;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  background: radial-gradient(circle at 70% 80%, rgba(19, 26, 41, 0.35), transparent 45%), var(--bg);
}

.top-nav {
  width: 100%;
  padding: 18px 26px;
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 18px;
  position: relative;
  z-index: 2;
}

.top-nav a {
  color: #cfcfcf;
  text-decoration: none;
}

.logo {
  font-weight: 700;
  font-size: 21px;
}

.logo-white {
  color: #e0e0e0;
}

.logo-purple {
  color: var(--purple);
}

.menu-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 18px;
}

.lang-switch {
  display: flex;
  gap: 6px;
}

.lang-btn {
  color: #a2a2a2;
  border: 1px solid rgba(91, 27, 255, 0.58);
  background: transparent;
  height: 22px;
  padding: 0 8px;
  font-family: inherit;
  font-size: 11px;
  cursor: pointer;
  transition: color 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

.lang-btn:hover,
.lang-btn.active {
  color: #ffffff;
  border-color: #ffffff;
  box-shadow: 0 0 10px rgba(91, 27, 255, 0.3);
}

.menu {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  font-size: 17px;
}

.menu-link {
  opacity: 0.8;
  transition: opacity 260ms ease, color 260ms ease, text-shadow 320ms ease;
}

.menu-link:hover,
.menu-link.active {
  opacity: 1;
  color: #ffffff;
  text-shadow: 0 0 12px rgba(91, 27, 255, 0.35);
}

.icons {
  display: flex;
  gap: 8px;
  font-size: 16px;
}

.icons a {
  color: var(--purple);
  border: 1px solid var(--purple);
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  line-height: 1;
}

.hero {
  min-height: calc(100vh - 68px);
  display: flex;
  align-items: center;
  padding-left: 22%;
  padding-bottom: 8vh;
  position: relative;
  z-index: 2;
}

.accent-line {
  width: 1px;
  height: 340px;
  background: linear-gradient(to bottom, transparent, var(--line), transparent);
  position: relative;
  margin-right: 24px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--purple);
  position: absolute;
  left: -3.5px;
  box-shadow: 0 0 12px rgba(91, 27, 255, 0.7);
  animation: pulseDot 2.6s ease-in-out infinite;
}

.dot.top {
  top: 26px;
}

.content {
  min-width: min(720px, 90vw);
  min-height: 320px;
  position: relative;
}

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.992);
  filter: blur(2px);
  pointer-events: none;
}

.slide.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  filter: blur(0);
  pointer-events: auto;
  z-index: 2;
}

.slide.entering {
  visibility: visible;
  pointer-events: none;
  z-index: 3;
  animation: luxuryIn 920ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.slide.leaving {
  visibility: visible;
  pointer-events: none;
  z-index: 1;
  animation: luxuryOut 760ms cubic-bezier(0.4, 0, 1, 1) forwards;
}

.content h1 {
  margin: 0;
  font-size: clamp(44px, 5vw, 70px);
  line-height: 1;
}

.content .white {
  color: #d9d9d9;
  font-weight: 800;
}

.content .purple {
  color: var(--purple);
  font-weight: 800;
}

.name {
  margin: 18px 0 0;
  color: var(--purple);
  font-size: clamp(22px, 1.6vw, 30px);
}

.desc {
  margin-top: 20px;
  color: var(--text-muted);
  font-size: clamp(26px, 2vw, 34px);
  line-height: 1.35;
}

.work-intro {
  margin: 14px 0 0;
  max-width: 760px;
  color: #b6b6b6;
  font-size: clamp(14px, 1.1vw, 18px);
  line-height: 1.5;
}

.work-meta {
  margin: 10px 0 0;
  color: var(--purple);
  font-size: clamp(12px, 0.95vw, 15px);
  letter-spacing: 0.03em;
}

.gallery-open {
  margin-top: 18px;
  color: var(--purple);
  background: transparent;
  border: 1px solid var(--purple);
  height: 32px;
  padding: 0 14px;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: color 220ms ease, border-color 220ms ease, box-shadow 220ms ease,
    background-color 220ms ease;
}

.gallery-open:hover {
  color: #ffffff;
  border-color: #ffffff;
  background-color: rgba(91, 27, 255, 0.15);
  box-shadow: 0 0 12px rgba(91, 27, 255, 0.35);
}

.gallery-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(3, 7, 12, 0.8);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 320ms ease, visibility 0ms linear 320ms;
  z-index: 50;
}

.gallery-modal.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0ms;
}

.gallery-panel {
  width: min(860px, 92vw);
  border: 1px solid rgba(91, 27, 255, 0.5);
  background: linear-gradient(180deg, rgba(9, 15, 24, 0.98), rgba(5, 10, 16, 0.98));
  padding: 14px 20px 14px;
  position: relative;
  transform: translateY(18px) scale(0.985);
  opacity: 0;
  transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1), opacity 320ms ease;
  box-shadow: 0 24px 80px rgba(2, 3, 8, 0.55), 0 0 28px rgba(91, 27, 255, 0.18);
}

.gallery-modal.open .gallery-panel {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.gallery-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.gallery-title {
  margin: 0;
  color: #b4b4b4;
  font-size: 13px;
  text-transform: lowercase;
  letter-spacing: 0.04em;
}

.gallery-close {
  width: 26px;
  height: 26px;
  border: 1px solid var(--purple);
  background: transparent;
  color: var(--purple);
  font-family: inherit;
  cursor: pointer;
  transition: color 220ms ease, border-color 220ms ease;
}

.gallery-close:hover {
  color: #ffffff;
  border-color: #ffffff;
}

.gallery-stage {
  border: 1px solid rgba(91, 27, 255, 0.42);
  padding: 10px 10px 30px;
  position: relative;
  min-height: min(52vw, 460px);
  overflow: hidden;
}

.gallery-slide {
  margin: 0;
  position: absolute;
  inset: 10px 10px 24px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.992);
  filter: blur(3px);
  transition: opacity 560ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 660ms cubic-bezier(0.22, 1, 0.36, 1), filter 460ms ease,
    visibility 0ms linear 660ms;
  will-change: opacity, transform, filter;
}

.gallery-slide.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  filter: blur(0);
  transition-delay: 0ms, 0ms, 0ms, 0ms;
}

.gallery-image {
  width: 100%;
  height: min(45vw, 390px);
  border: 1px solid rgba(91, 27, 255, 0.5);
  background: #060c13;
  position: relative;
  overflow: hidden;
  object-fit: contain;
  object-position: center center;
}

.gallery-slide figcaption {
  margin-top: 10px;
  color: #b7b7b7;
  font-size: 15px;
}

.gallery-desc {
  margin: 8px 0 20px;
  color: #d0d0d0;
  font-size: 14px;
  line-height: 1.4;
}

.gallery-meta {
  margin-top: 10px;
  color: #9f9f9f;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.gallery-controls {
  display: flex;
  gap: 8px;
}

.gallery-nav {
  color: var(--purple);
  border: 1px solid rgba(91, 27, 255, 0.75);
  background: transparent;
  height: 26px;
  padding: 0 10px;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: color 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.gallery-nav:hover {
  color: #ffffff;
  border-color: #ffffff;
  box-shadow: 0 0 12px rgba(91, 27, 255, 0.32);
}

.contact-info {
  margin-top: 18px;
  max-width: 760px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 7px 0;
}

.contact-item a {
  color: var(--purple);
  border: 1px solid var(--purple);
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  line-height: 1;
  text-decoration: none;
  transition: color 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.contact-item a:hover {
  color: #ffffff;
  border-color: #ffffff;
  box-shadow: 0 0 12px rgba(91, 27, 255, 0.4);
}

.contact-item p {
  margin: 0;
  color: #b6b6b6;
  font-size: clamp(14px, 1.1vw, 18px);
}

.contact-phone {
  margin: 14px 0 0;
  color: #c7c7c7;
  font-size: clamp(16px, 1.2vw, 20px);
}

.contact-phone a {
  color: var(--purple);
  text-decoration: none;
  transition: color 220ms ease;
}

.contact-phone a:hover {
  color: #ffffff;
}

.slide.active h1,
.slide.entering h1 {
  animation: textLift 760ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.slide.active .name,
.slide.entering .name {
  animation: textLift 840ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.slide.active .desc,
.slide.entering .desc {
  animation: textLift 930ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes luxuryIn {
  0% {
    opacity: 0;
    transform: translateY(22px) scale(0.988);
    filter: blur(4px);
  }

  60% {
    opacity: 1;
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes luxuryOut {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }

  100% {
    opacity: 0;
    transform: translateY(-12px) scale(0.996);
    filter: blur(3px);
  }
}

@keyframes textLift {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulseDot {
  0%,
  100% {
    box-shadow: 0 0 8px rgba(91, 27, 255, 0.45);
  }

  50% {
    box-shadow: 0 0 18px rgba(91, 27, 255, 0.85);
  }
}

@media (max-width: 1200px) {
  .top-nav {
    font-size: 16px;
  }

  .menu {
    font-size: 15px;
    gap: 12px;
  }

  .hero {
    padding-left: 12%;
  }

  .accent-line {
    height: 280px;
  }

  .desc {
    font-size: clamp(20px, 2.4vw, 28px);
  }
}

@media (max-width: 760px) {
  .top-nav {
    padding: 14px 14px;
    flex-wrap: wrap;
    gap: 10px;
  }

  .menu-right {
    margin-left: 0;
    width: 100%;
    justify-content: space-between;
  }

  .lang-btn {
    height: 20px;
    padding: 0 6px;
    font-size: 10px;
  }

  .menu {
    gap: 10px;
    font-size: 13px;
  }

  .hero {
    min-height: calc(100vh - 110px);
    padding: 20px;
    align-items: flex-start;
    padding-top: 20vh;
  }

  .accent-line {
    height: 220px;
    margin-right: 16px;
  }

  .desc {
    font-size: 20px;
  }

  .work-intro {
    font-size: 14px;
  }

  .work-meta {
    font-size: 12px;
  }

  .content {
    min-height: 280px;
  }

  .contact-item p {
    font-size: 14px;
  }

  .contact-phone {
    font-size: 16px;
  }

  .gallery-open {
    height: 30px;
    padding: 0 12px;
    font-size: 13px;
  }

  .gallery-image {
    height: min(50vw, 300px);
  }

  .gallery-slide figcaption {
    font-size: 13px;
  }

  .gallery-desc {
    font-size: 12px;
  }
}
