/* MAX GOR — portfolio, premium design */

:root {
  --bg: #05080c;
  --bg-elevated: rgba(12, 18, 28, 0.72);
  --text: rgba(255, 255, 255, 0.92);
  --text-muted: rgba(255, 255, 255, 0.55);
  --text-soft: rgba(255, 255, 255, 0.72);
  --stroke: rgba(255, 255, 255, 0.08);
  --accent: #3dd6c6;
  --accent-2: #4f8cff;
  --radius-lg: 28px;
  --radius-md: 16px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

main {
  scroll-snap-type: y proximity;
  scroll-padding-top: 6rem;
  overflow-anchor: none;
  overflow-x: clip; 
  width: 100%;
}

.hero,
.section,
.section-divider,
.footer {
  scroll-snap-align: start;
}

a {
  color: inherit;
  text-decoration: none;
}

strong {
  font-weight: 600;
  color: var(--text);
}

code {
  font-size: 0.85em;
  padding: 0.15em 0.4em;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
}

/* Film grain */
.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9000;
  opacity: 0.04;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Ambient gradient blobs */
.gradient-blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.45;
  pointer-events: none;
  z-index: 0;
  will-change: transform;
}

.gradient-blob--1 {
  width: min(80vw, 620px);
  height: min(80vw, 620px);
  top: -20%;
  right: -18%;
  background: radial-gradient(circle at 20% 20%, #206fca 0%, #0a3a7a 42%, transparent 72%);
}

.gradient-blob--2 {
  width: min(72vw, 520px);
  height: min(72vw, 520px);
  bottom: -6%;
  left: -18%;
  background: radial-gradient(circle at 55% 55%, #1ec8a8 0%, #05433d 46%, transparent 74%);
}

.gradient-blob--3 {
  width: min(62vw, 520px);
  height: min(62vw, 520px);
  top: 12%;
  left: 62%;
  opacity: 0.22;
  background: radial-gradient(circle at 45% 40%, #4f8cff 0%, #1c3b72 48%, transparent 78%);
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem clamp(1.25rem, 4vw, 3rem);
  background: linear-gradient(to bottom, rgba(5, 8, 12, 0.94), rgba(5, 8, 12, 0));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  width: 100%;
}

.header-brand {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--text-muted);
  pointer-events: none;
  white-space: nowrap;
}

/* Mobile header adjustments */
@media (max-width: 768px) {
  .header {
    padding: 1rem 0.4rem;
    z-index: 200;
  }
  .header-brand {
  
  font-size: 0.78rem;
  
  letter-spacing: 0.1em;
  
}
}

.nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav a {
  font-size: 0.9rem;
  font-weight: 450;
  color: var(--text-muted);
  transition: color 0.25s var(--ease-out);
}

.nav a:hover {
  color: var(--text);
}

.nav-cta {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--stroke);
  color: var(--text) !important;
}

.nav-cta:hover {
  background: rgba(255, 255, 255, 0.1);
}

.lang-switch {
  display: flex;
  gap: 0.25rem;
}

.lang-switch button {
  background: none;
  border: none;
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}

.lang-switch button.is-active,
.lang-switch button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
}

.menu-btn {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: rgba(12, 18, 28, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  cursor: pointer;
  padding: 0;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s, background 0.2s;
}

.menu-btn:active {
  transform: scale(0.95);
  background: rgba(20, 30, 45, 0.9);
}

.menu-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-soft);
  border-radius: 1px;
}

/* Hero */
.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: clamp(5.5rem, 14vh, 9rem) clamp(1.25rem, 5vw, 4rem) 4rem;
  /* overflow-x: hidden; */
}

.hero-ripple {
  position: absolute;
  inset: -20% -10% -10%;
  z-index: 0;
  pointer-events: none;
  background:
    repeating-radial-gradient(
      circle at 50% 38%,
      transparent 0,
      transparent 48px,
      rgba(255, 255, 255, 0.012) 48px,
      rgba(255, 255, 255, 0.012) 49px
    );
  opacity: 0.65;
  mask-image: radial-gradient(ellipse 70% 55% at 50% 40%, black 20%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse 70% 55% at 50% 40%, black 20%, transparent 72%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.hero-name {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.2em;
  margin: 0;
}

.hero-design-stack {
  position: relative;
  margin: 0;
  padding: 0;
  width: auto;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.6rem;
  font-size: 100%;
  font-weight: inherit;
  white-space: nowrap;
  overflow: visible;
  width: 100%;
}

/* ─── DESIGNER split-to-merge animation ─── */
.hero-designer {
  display: inline-block;
  width: auto;
  font-size: clamp(8rem, 16vw, 16rem);
  max-width: 100%;
  font-weight: 900;
  line-height: 0.82;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  cursor: default;
  user-select: none;
  position: relative;
  color: transparent;
  background: linear-gradient(
    135deg,
    rgba(100, 181, 255, 0.18) 0%,
    rgba(46, 128, 158, 0.16) 45%,
    rgba(35, 69, 118, 0.12) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: transform 2.6s var(--ease-out), opacity 2.6s var(--ease-out);
  transform: translate(16px, 16px);
}

.hero-designer::before {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  color: transparent;
  background: linear-gradient(
    165deg,
    rgba(86, 153, 221, 0.65) 0%,
    rgba(52, 112, 173, 0.68) 30%,
    rgba(24, 96, 135, 0.72) 70%,
    rgba(12, 64, 105, 0.8) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  transform: translate(-16px, -16px);
  opacity: 0.68;
  transition: transform 2.6s var(--ease-out), opacity 2.6s var(--ease-out);
  pointer-events: none;
  z-index: 1;
}

.hero-designer::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  color: transparent;
  background: linear-gradient(
    165deg,
    rgba(100, 194, 255, 0.95) 0%,
    rgba(38, 178, 150, 0.95) 40%,
    rgba(68, 131, 204, 0.95) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  mask-image: radial-gradient(
    circle var(--spot-radius, 200px) at var(--spot-x, 50%) var(--spot-y, 50%),
    black 0%,
    black 30%,
    transparent 100%
  );
  -webkit-mask-image: radial-gradient(
    circle var(--spot-radius, 200px) at var(--spot-x, 50%) var(--spot-y, 50%),
    black 0%,
    black 30%,
    transparent 100%
  );
  opacity: var(--spot-opacity, 0);
  transition: opacity 0.35s var(--ease-out), transform 0.35s var(--ease-out);
  pointer-events: none;
  z-index: 2;
}

.hero:hover .hero-designer::after {
  opacity: 1;
}

.hero-cursor-wave {
  position: absolute;
  width: 28px;
  height: 28px;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%);
}

.hero-cursor-wave::before,
.hero-cursor-wave::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1.5px solid rgba(94, 234, 212, 0.35);
  border-radius: 50%;
  opacity: 0;
  will-change: transform, opacity;
}

.hero-cursor-wave::before {
  animation: wave-ring 1.2s ease-out infinite;
}

.hero-cursor-wave::after {
  animation: wave-ring 1.8s ease-out infinite 0.4s;
}

.hero-cursor-wave.is-active {
  opacity: 1;
}

.hero-designer.is-glitch,
.hero-designer.is-glitch::before,
.hero-designer.is-glitch::after {
  animation: hero-glitch 2.4s ease-in-out 1 both;
}

.hero-designer.is-merged,
.hero-designer.is-merged::before,
.hero-designer.is-merged::after {
  transform: translate(0, 0);
  opacity: 1;
}

@keyframes hero-glitch {
  0%, 5% {
    transform: translate(-16px,-16px);
    clip-path: inset(0 0 0 0);
    opacity: 0.72;
  }
  8% {
    transform: translate(-24px,-18px) skewX(-2deg);
    clip-path: inset(10% 0 10% 0);
    opacity: 0.62;
  }
  12% {
    transform: translate(14px,-8px) skewX(1.5deg);
    clip-path: inset(0 20% 0 0);
    opacity: 0.8;
  }
  16% {
    transform: translate(-10px,-14px) skewX(-1deg);
    clip-path: inset(5% 0 12% 0);
    opacity: 0.7;
  }
  20% {
    transform: translate(8px,-4px) skewX(2deg);
    clip-path: inset(0 0 20% 0);
    opacity: 0.85;
  }
  24% {
    transform: translate(-4px,0) skewX(-0.5deg);
    clip-path: inset(0 8% 0 12%);
    opacity: 0.9;
  }
  30% {
    transform: translate(0,0) skewX(0);
    clip-path: inset(0 0 0 0);
    opacity: 1;
  }
  100% {
    transform: translate(0,0);
    clip-path: inset(0 0 0 0);
    opacity: 1;
  }
}

@keyframes wave-ring {
  0% {
    transform: scale(0);
    opacity: 1;
    border-width: 1.5px;
  }
  100% {
    transform: scale(8);
    opacity: 0;
    border-width: 1.5px;
  }
}

.hero-role {
  display: none;
}

.hero-name {
  
  
  text-align: center;
  position: relative;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: 0.2em;
  color: #fff;
  text-transform: uppercase;
  white-space: nowrap;
  z-index: 3;
  text-shadow:
    0 2px 24px rgba(0, 0, 0, 0.55),
    0 0 60px rgba(0, 30, 40, 0.4);
  pointer-events: none;
  padding: 20px 0;
}

.hero-role {
  margin: 0 0 1rem;
  font-size: clamp(0.82rem, 2vw, 0.95rem);
  font-weight: 700;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  background: linear-gradient(90deg, #3ee0ff 0%, #2ee8c8 50%, #3dd6a4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-lead {
  margin: 2.2rem auto 2rem;
  max-width: 720px;
  font-size: clamp(1rem, 2.1vw, 1.15rem);
  font-weight: 400;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.65;
}

.hero-cta {
  font-weight: 700;
  font-size: 1.05rem;
  padding: 1.15rem 2.5rem;
  letter-spacing: 0.06em;
  border-radius: 999px;
}

.hero-scroll-stick {
  width: 2px;
  height: 60px;
  background: linear-gradient(to bottom, #3ed6c6, transparent);
  margin-top: 3rem;
  border-radius: 2px;
}

/* Sections */
.section {
  padding: 4rem clamp(1.25rem, 5vw, 4rem);
  max-width: 1440px;
  margin: 0 auto;
  scroll-margin-top: 6rem;
}

.section-header {
  max-width: 640px;
  margin-bottom: 36px;
}

.section-header h2 {
  margin: 0 0 0.5rem;
  font-size: clamp(3rem, 5vw, 5rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.section-sub {
  margin: 0;
  font-size: 1rem;
  color: var(--text-muted);
}

.projects .section-header {
  text-align: center;
  max-width: 100%;
  margin-bottom: 36px;
}

.glass {
  background: var(--bg-elevated);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

/* Custom Stagger Reveal */
.reveal.custom-stagger {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
  transition-delay: var(--delay, 0s);
}

.reveal.custom-stagger.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Experience Unified Block */
.exp-wrap {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 1080px;
  margin: 0 auto;
}

.exp-main {
  padding: clamp(2rem, 5vw, 3.5rem);
  background: rgba(18, 18, 22, 0.45);
}

.exp-main h2 {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 700;
  margin: 0 0 1.5rem;
  color: #fff;
}

.exp-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.exp-list li {
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  color: var(--text-soft);
  line-height: 1.6;
}

.exp-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center; 
  gap: 1.5rem;
}

.exp-grid > * {
  flex-basis: 300px; 
  flex-grow: 1;      
  max-width: 400px;  
}

.exp-skill {
  padding: clamp(1.5rem, 3vw, 2rem);
  background: rgba(18, 18, 22, 0.45);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: transform 0.4s var(--ease-out), border-color 0.4s;
}

.exp-skill:hover {
  transform: translateY(-8px);
  border-color: rgba(62, 214, 198, 0.3);
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.card-icon svg {
  width: 24px;
  height: 24px;
}

.exp-skill h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
  margin: 0;
}

.exp-skill p {
  color: var(--text-soft);
  line-height: 1.5;
  font-size: 0.95rem;
  margin: 0;
}

/* ═══════════════════════════════════════════════
   Projects — Neutral Layout Redesign
   ═══════════════════════════════════════════════ */
.projects {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Project Section Wrapper (Full Bleed) */
.project-section {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  padding: clamp(4rem, 8vw, 7rem) clamp(1.25rem, 5vw, 4rem);
  box-sizing: border-box;
  background: transparent; /* Default: Parallax shines through */
}

.project-section:nth-of-type(odd) {
  background: #020408; /* Solid dark/black background to hide parallax */
}

/* Limit content width to match the rest of the site */
.project-header, .project-media {
  width: 100%;
  max-width: calc(1440px - (clamp(1.25rem, 5vw, 4rem) * 2));
  margin: 0 auto;
}

/* Project Header */
.project-header {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 2rem;
  padding: 0 clamp(0.5rem, 2vw, 1.5rem);
  margin-bottom: 2rem;
}

.project-info {
  flex: 1;
  max-width: 600px;
}
.project-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between; 
  align-items: flex-end;
}
.project-link {
  margin-bottom: 20px; 
}
.project-tags-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end; 
}

.project-stack {
  display: flex;
  flex-direction: row-reverse;
  flex-wrap: wrap;
  justify-content: flex-start; 
  align-items: flex-end;
  align-content: flex-end;
  gap: 8px;
  padding: 0;
  list-style: none;
  margin-top: auto;
}
.project-stack.project-stack--left {
  flex-direction: row; 
  justify-content: flex-start;
}

@media (max-width: 768px) {
  .project-info {
    flex-direction: column;
    gap: 20px;
  }
  
  .project-meta {
    align-items: flex-start; 
    gap: 16px;
  }
  .project-tags-container {
    justify-content: flex-start; 
  }
  
  .project-stack {
    justify-content: flex-start;
  }
}

.project-title {
  margin: 0 0 0.5rem;
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.05em;
}

.project-desc {
  font-size: clamp(0.8rem, 1.1rem, 1.1rem);
  font-weight: 300;
  color: var(--text-soft);
  line-height: 1.6;
  letter-spacing: 0.02em;
}


.project-link {
  font-size: 1.05rem;
  font-weight: 500;
  color: #2997ff; /* Neutral blue link */
  text-decoration: none;
  transition: opacity 0.2s;
  white-space: nowrap;
  padding-top: 0.5rem;
}

.project-link:hover {
  opacity: 0.7;
}


.project-stack li {
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Project Inner Media Container (Now transparent, no card) */
.project-media {
  width: 100%;
  max-width: min(100%, calc(1440px - (clamp(1.25rem, 5vw, 4rem) * 2)));
  margin: 0 auto;
}

.project-promo-link {
  display: block;
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.project-promo-link:hover {
  border-color: rgba(62, 214, 198, 0.35);
}

.project-promo-link:hover .project-promo {
  transform: scale(1.03);
}

.project-promo-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) translateY(8px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  min-width: 0;
  transition: opacity 0.24s ease, transform 0.24s ease;
  color: #fff;
  font-size: clamp(0.95rem, 1vw, 1.05rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
  z-index: 2;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 999px;
  padding: 0.85rem 1.5rem;
  backdrop-filter: blur(14px);
  background: rgba(0, 0, 0, 0.36);
}

.project-promo-link:hover .project-promo-overlay {
  opacity: 1;
  transform: translate(-50%, -50%) translateY(0);
}

.project-promo-link.under-construction {
  pointer-events: none;
}

.project-promo-link.under-construction .project-promo-overlay {
  opacity: 1;
  transform: translate(-50%, -50%) translateY(0);
}

.project-promo {
  display: block;
  width: 100%;
  max-width: 1200px;
  height: auto;
  object-fit: cover;
  object-position: top;
  border-radius: 0;
  box-sizing: border-box;
  transition: transform 0.4s var(--ease-out);
  transform-origin: center center;
}

/* ─── Neutral-Style Carousel (Scroll Snap) ─── */
.carousel {
  position: relative;
  z-index: 1;
  padding: clamp(2rem, 3vw, 4rem) 0 0;
}

.carousel-viewport {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  border-radius: var(--radius-md);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Hide standard Firefox scrollbar */
  cursor: grab;
}

.carousel-viewport:active {
  cursor: grabbing;
}

.carousel-viewport::-webkit-scrollbar {
  display: none; /* Hide WebKit scrollbar */
}

.carousel-track {
  display: flex;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.carousel-slide {
  flex: 0 0 min(85vw, 340px);
  scroll-snap-align: center;
  aspect-ratio: 1 / 1;
}

@media (min-width: 640px) {
  .carousel-slide {
    flex: 0 0 min(46vw, 360px);
  }
  
}

@media (min-width: 1024px) {
  .carousel-slide {
    flex: 0 0 min(280px, calc(33.333% - 1rem));
    scroll-snap-align: start;
  }
}

.carousel-thumb {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  overflow: hidden;
  cursor: zoom-in;
  background: rgba(0, 0, 0, 0.35);
  transition: transform 0.3s var(--ease-out), border-color 0.3s, box-shadow 0.3s;
}

.carousel-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(5,8,12,0.85) 100%);
  z-index: 1;
}

.carousel-thumb:hover {
  border-color: rgba(62, 214, 198, 0.3);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}

.carousel-thumb:hover img {
  transform: scale(1.06);
}

.carousel-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s var(--ease-out);
  transform-origin: center center;
  height: 100%;
  object-fit: cover;
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: none;
  position: relative;
  z-index: 0;
  transition: transform 0.4s var(--ease-out);
}

.carousel--square .carousel-thumb img {
  aspect-ratio: 1 / 1;
}

/* Card Tags */
.carousel-tags {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  z-index: 2;
  pointer-events: none;
}

.carousel-tag {
  padding: 0.25rem 0.6rem;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* Neutral-style Bottom Controls */
.carousel-controls {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem 0.5rem 0;
}

.carousel-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #2a2a2a; /* Dark gray like screenshot */
  border: none;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s, opacity 0.3s;
}

.carousel-btn svg {
  width: 20px;
  height: 20px;
  transition: transform 0.2s;
}

.carousel-btn:hover {
  background: #3a3a3a;
  transform: scale(1.05);
}

.carousel-btn:active {
  transform: scale(0.95);
}

.carousel-btn.is-hidden {
  opacity: 0.3;
  pointer-events: none;
}

/* 3D Scroll Carousel */
.carousel-3d-wrapper {
  position: relative;
  width: 100%;
  height: 250vh;
  margin-top: 2rem;
}

.carousel-3d-sticky {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1200px;
  
}

.carousel-3d-scene {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  will-change: transform;
}

.carousel-3d-card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(280px, 35vw, 420px);
  aspect-ratio: 1 / 1;
  will-change: transform, opacity;
  transform-origin: 50% 50%;
  transition: opacity 0.3s;
}

.carousel-3d-card .carousel-thumb {
  width: 100%;
  height: 100%;
  border-radius: 16px;
  display: block;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
}

.carousel-3d-card img {
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 16px;
  display: block;
}

.scroll-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px; 
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--stroke);
  color: var(--text) !important;
  text-decoration: none;
  transition: all 0.3s ease;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
}

.scroll-down-btn {
  bottom: 40px;  
}
.scroll-up-btn {
  top: 100px; 
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease-in-out;
  pointer-events: none;
 
  transform: translateX(-50%) translateY(-20px); 
}

.scroll-up-btn.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.scroll-down-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateX(-50%) translateY(4px); 
}

.scroll-up-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateX(-50%) translateY(-4px); /* Сдвигаем вверх, а не вниз */
}






/* Mobile adaptations for 3D carousel */
@media (max-width: 768px) {
  .carousel-3d-wrapper {
    height: 300vh;
  }

  .carousel-3d-sticky {
    perspective: 800px;
  }

  .carousel-3d-card {
    width: clamp(200px, 50vw, 300px);
  }
}

@media (max-width: 480px) {
  .carousel-3d-wrapper {
    height: 250vh;
  }

  .carousel-3d-sticky {
    perspective: 600px;
  }

  .carousel-3d-card {
    width: clamp(180px, 60vw, 250px);
  }
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.lightbox[hidden] {
  display: none !important;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 12, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  cursor: zoom-out;
}

.lightbox-panel {
  position: relative;
  z-index: 1;
  max-width: min(96vw, 1280px);
  max-height: min(92vh, 900px);
  pointer-events: none;
}

.lightbox-img {
  display: block;
  max-width: min(96vw, 1280px);
  max-height: min(88vh, 860px);
  width: auto;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  pointer-events: auto;
}

.lightbox-close {
  position: absolute;
  top: -48px;
  right: 0;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background: rgba(8, 12, 20, 0.85);
  color: var(--text);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s, transform 0.25s;
  pointer-events: auto;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: scale(1.05);
}

@media (max-width: 640px) {
  .lightbox-close {
    top: -40px;
    right: -4px;
  }

  .hero-designer {
    font-size: clamp(6rem, 24vw, 12rem);
    letter-spacing: -0.01em;
  }
}

/* Divider Stick before Contact */
.section-divider {
  display: flex;
  justify-content: center;
  width: 100%;
  padding-bottom: 2rem;
}

.section-divider .hero-scroll-stick {
  margin-top: 0;
}

/* Contact */
.contact {
  padding-bottom: clamp(5rem, 12vw, 8rem);
}

.contact-panel {
  max-width: 800px;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 4rem) 1rem;
  text-align: center;
}

.contact-panel h2 {
  margin: 0 0 1rem;
  font-size: clamp(2.5rem, 4vw, 4.5rem);
  font-weight: 700;
}

.contact-lead {
  margin: 0 auto 2.5rem;
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 500px;
  line-height: 1.6;
}

.contact-actions-vertical {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.contact-email-link {
  font-size: clamp(28px, 6vw, 4.5rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(90deg, #ffffff 0%, rgba(200,215,255,0.7) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: opacity 0.25s, transform 0.25s;
}

.contact-email-link:hover {
  opacity: 0.8;
  transform: scale(1.02);
}

.contact-tel-link {
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text-soft);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 2px;
  transition: color 0.2s, border-color 0.2s;
}

.contact-tel-link:hover {
  color: #fff;
  border-color: #fff;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.75rem;
  font-size: 0.95rem;
  font-weight: 500;
  font-family: inherit;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s, background 0.25s;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(90deg, #3b82f6 0%, #22d3c8 55%, #2dd4bf 100%);
  box-shadow: 0 12px 40px rgba(59, 130, 246, 0.35);
}

.btn-primary:hover {
  transform: scale(1.02);
  box-shadow: 0 16px 48px rgba(94, 234, 212, 0.25);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid var(--stroke);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.02);
}

/* Footer */
.footer {
  position: relative;
  z-index: 1;
  padding: 2rem clamp(1.5rem, 5vw, 4rem) 3rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children when in view */
.about-grid .reveal:nth-child(1) { transition-delay: 0s; }
.about-grid .reveal:nth-child(2) { transition-delay: 0.06s; }
.about-grid .reveal:nth-child(3) { transition-delay: 0.12s; }
.about-grid .reveal:nth-child(4) { transition-delay: 0.18s; }

.projects > article.project-section.reveal:nth-child(3) {
  transition-delay: 0.1s;
}

/* Nav Mobile Overlay Background */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 90;
  opacity: 0;
  transition: opacity 0.4s ease-out;
}
.nav-overlay.is-active {
  display: block;
  opacity: 1;
}

@media (max-width: 840px) {
  .project-header {
    flex-direction: column;
    gap: 1rem;
  }
}

/* Mobile */
@media (max-width: 944px) {
  .nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(280px, 85vw);
    flex-direction: column;
    align-items: flex-start;
    padding: 5rem 1.5rem 2rem;
    background: rgba(8, 12, 20, 0.97);
    backdrop-filter: blur(20px);
    border-left: 1px solid var(--stroke);
    transform: translateX(100%);
    transition: transform 0.4s var(--ease-out);
  }

  .nav.is-open {
    transform: translateX(0);
    height: 100vh;
    
  }

  .nav a {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text);
    padding-left: 8px;
  }

  .nav-cta {
    margin-top: 0rem;
    
  }

  .lang-switch {
    margin-left: 0;
    margin-top: 0rem;
  }

  .lang-switch button {
    font-size: 0.8rem;
    padding: 0.5rem 0.4rem;
  }

  .menu-btn {
    display: flex;
    z-index: 110;
  }

  body.nav-open {
    overflow: hidden;
  }

  .hero-scroll {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .gradient-blob {
    transform: none !important;
  }
}
